Introduction
This is one is pretty straightforward. We will be drawing a snake in ascii. This was inspired by that old snake game where you have to collect the fruit and you continuously grow.
Definition
Given a positive integer N that represents the snake's length, draw a snake so that it has a body of n plus a head and a tail.
Parts:
- head:
<, >, ^, v
- tail:
@
- vertical:
|
- horizonal:
-
All corners should be satisfied with a \
or /
respectively. Unless the head ends on a corner in which case the head <, >, ^, v
takes priority in the direction the snake is curled. i.e. for the length 1 example, it is turned counter clockwise and so the head is turned that way. For a clockwise solution it would be to the right >
.
The snake must start in the middle with its tail but it may go outwards in any direction you choose either clockwise or counter-clockwise. It must also wrap tightly around itself as it expands outwards in a circular fashion.
Example
/--\
|/\|
||@|
|\-/
\--->
Where the @
is the tail and starting position. As seen above the tail starts in the middle, goes up to the left in a counter-clockwise rotation outward.
Here the length is 19
plus a tail and a head.
As another example, here is length 1
:
<\
@
Winning
This is code-golf so the answer that is submitted with the smallest number of bytes wins, with time to be used as a tie breaker.
Have fun!
@---->
. You probably intend more strict conditions about the snake shape. Also make clear how much whitespace is or isn't allowed \$\endgroup\$@
is the middle (possible add some spaces to make it so), declare "to the right" to be the direction and make just the head point down and declare that clockwise. Your terms may seem clear to you, but they are actually ambiguous. I realize you probably mean an as tightly as possible coiled snake, but you should make that clear \$\endgroup\$