See also: Rotatagons
Challenge
Given a string as input, output its wordagon.
Wordagons
A wordagon is a way of representing a string in a hexagon. Now, let's create a wordagon from the string hexa
:
Firstly, you start with the first character in the string a place it in the centre:
h
Then, you take the next character in the string and add a hexagonal layer:
e e
e h e
e e
Then, add the next layer:
x x x
x e e x
x e h e x
x e e x
x x x
Finally, add the last layer:
a a a a
a x x x a
a x e e x a
a x e h e x a
a x e e x a
a x x x a
a a a a
And you now have the wordagon for the string hexa
.
Examples
Here's some I prepared earlier:
hello
o o o o o
o l l l l o
o l l l l l o
o l l e e l l o
o l l e h e l l o
o l l e e l l o
o l l l l l o
o l l l l o
o o o o o
PPcg
g g g g
g c c c g
g c P P c g
g c P P P c g
g c P P c g
g c c c g
g g g g
o *
* * *
* *
* o *
* *
* * *
(T_T)
) ) ) ) )
) T T T T )
) T _ _ _ T )
) T _ T T _ T )
) T _ T ( T _ T )
) T _ T T _ T )
) T _ _ _ T )
) T T T T )
) ) ) ) )
Note that trailing and/or leading newlines are allowed.
Winning
The shortest code in bytes wins.