Write a program or function that takes in a positive integer and prints or returns a stack of that many ASCII-art turtles, where each turtle is larger than the one above it.
Specifically, if the input is 1
, the output should be:
__
/,,\o
If the input is 2
:
__
o/,,\
____
/,__,\o
If the input is 3
:
__
/,,\o
____
o/,__,\
______
/,____,\o
If the input is 4
:
__
o/,,\
____
/,__,\o
______
o/,____,\
________
/,______,\o
If the input is 5
:
__
/,,\o
____
o/,__,\
______
/,____,\o
________
o/,______,\
__________
/,________,\o
And so on in the same pattern for larger inputs.
Note that:
- The head (the
o
) of the bottom turtle is always on the right. The heads of the turtles above then alternate back and forth. - No lines may have trailing spaces.
- Superfluous leading spaces are not allowed. (i.e. the back of the bottom turtle should be at the start of the line.)
- A single optional trailing newline is allowed.
The shortest code in bytes wins.
,________,
When someone says something that makes no sense. \$\endgroup\$