74
11
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.
11trichoplax, I'm expecting an answer that uses recursion. – El'endia Starman – 2016-08-03T23:40:36.890
15
,________,
When someone says something that makes no sense. – R. Kap – 2016-08-04T00:43:20.7338Flipping sides to make sure that every turtle looking up or down sees an ass? – Basic – 2016-08-04T16:06:28.030
15I'm glad you specified ASCII turtles. Otherwise, I was going to finally submit a Logo answer where I didn't have to waste 3 bytes to hide the turtle. – GuitarPicker – 2016-08-04T21:47:19.763
3That's not all the way down, that's only a finite distance down. – user253751 – 2016-08-05T01:04:07.197
4I like turtles! – Scotty.NET – 2016-08-05T10:59:46.080
4I would have tried posting but that is always heading the same way... – Tobias Kienzler – 2016-08-05T13:10:45.207
3@TobiasKienzler I'm sure there are languages which can mirror characters, be creative :-) – Mast – 2016-08-05T19:17:50.917
3Stacked turtles look like Christmas trees. – A.L – 2016-08-08T11:41:16.970
Mostly looks like Christmas fir-tree :3 – Limbo – 2018-12-14T16:29:44.080