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
Japt -R
, 16 15 14 bytes
pÔ¬Ëú°EDùEÃÆpÔ
pÔ¬Ëú°EDùEÃÆpÔ :Implicit input of string
p :Append
Ô : Reverse
¬ :Split
Ë :Map each D at 0-based index E
ú : Right pad
°E : to length E, prefix incremented
DùE : with D, left padded to length E
à :End map
Æ :Modify the last element, replacing it with
p : Append to input
Ô : Reverse
:Implicit output joined with newlines
0 comment threads