Comments on Word Set Square
Parent
Word Set Square
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.
[APL (Dyalog Unicode)], 23 byt …
3y ago
Japt `-R`, 16 15 14 bytes …
2y ago
Scala, 99 bytes ```scala s=> …
3y ago
[V (vim)], 23 bytes æw| …
3y ago
[Haskell], 110 bytes ```has …
4y ago
JavaScript, 76 bytes Output …
3y ago
Vyxal `J`, 12 bytes ``` ḣm …
3y ago
Ruby, 74 bytes Full program …
3y ago
JavaScript, 102 bytes s …
3y ago
Ruby, 70 bytes ```ruby ->s …
3y ago
[Python 3], 196 195 145 102 91 …
3y ago
Post
Python 3, 196 195 145 102 91 89 87 79 bytes
x=input();x+=x[::-1];i=-1
for c in x[:-1]:print(c*(i>-1)+" "*i+c);i+=1
print(x)
Golfed 50 bytes thanks to @celtschk's advice. Golfed another 43 bytes thanks to @celtschk's advice. Golfed another 11 bytes thanks to @celtschk's advice. Golfed another 2 bytes thanks to @celtschk's advice. Golfed 2 bytes thanks to @Moshi's advice. Golfed another 8 bytes thanks to @Moshi's advice.
0 comment threads