Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics

Dashboard
Notifications
Mark all as read
Challenges

Word Set Square

+1
−0

Challenge

Given a string, e.g. Hello, do the following:

Mirror it:

Hello -> HelloolleH

and create a right triangle using it as the sides:

H         
ee        
l l       
l  l      
o   o     
o    o    
l     l   
l      l  
e       e 
HelloolleH

Which looks sort of like a set square.

That's it!

Scoring

This is code-golf. Shortest answer in each language wins.

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comments

2 answers

+1
−0

V (vim), 23 bytes

æw|PòlÄxòjVLkîyllv$r $Ð

Try it online!

Hexdump:

00000000: e677 7c50 f26c c478 f26a 564c 6bee 796c  .w|P.l.x.jVLk.yl
00000010: 6c76 2472 2024 d0                        lv$r $.
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comments

+1
−0

Haskell, 110 bytes

f a=s>>=(#)$a++reverse a
[email protected](a:b)!f=f c:b!f
_!_=[]
f#n=n!((n!).f)
s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' '

Try it online!

Why does this post require moderator attention?
You might want to add some details to your flag.

0 comments

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!