3
Given a positive integer N, output the innermost N×N square of an ASCII art spiral made of -|/\
that spirals clockwise inward.
The -
is used for horizontal portions, |
for vertical portions, and /
and \
for corners. The first character is -
and the spiral proceeds left and down.
Specifically, when N is 1 the output is:
-
When N is 2 the output is:
/-
\-
When N is 3 the output is:
--\
/-|
\-/
When N is 4 the output is:
/--\
|/-|
|\-/
\---
Note how every output is a square of N by N characters.
The pattern continues in the same way:
N=1
-
N=2
/-
\-
N=3
--\
/-|
\-/
N=4
/--\
|/-|
|\-/
\---
N=5
----\
/--\|
|/-||
|\-/|
\---/
N=6
/----\
|/--\|
||/-||
||\-/|
|\---/
\-----
N=7
------\
/----\|
|/--\||
||/-|||
||\-/||
|\---/|
\-----/
N=8
/------\
|/----\|
||/--\||
|||/-|||
|||\-/||
||\---/|
|\-----/
\-------
etc.
The shortest code in bytes wins.
Aw shoot, I got ninja'd. ;-; Anyways, 16 bytes.
– totallyhuman – 2017-10-04T01:06:19.6032@icrieverytim Oh, I forgot about Decremented, it's too new. – Neil – 2017-10-04T01:08:06.530
Neil are you the creator of Charcoal? – Jonah – 2017-10-04T02:46:35.867
1
@Jonah ASCII-only, along with DLosc, created Charcoal.
– totallyhuman – 2017-10-04T04:32:44.423