Given a non-negative integer, print out an X
that is that big. X
is the output for input 0
, and you will add slashes equal to the input in each direction to extend the X
for larger inputs.
Test Cases
0
X
1
\ /
X
/ \
2
\ /
\ /
X
/ \
/ \
...
10
\ /
\ /
\ /
\ /
\ /
\ /
\ /
\ /
\ /
\ /
X
/ \
/ \
/ \
/ \
/ \
/ \
/ \
/ \
/ \
/ \
Rules
You may either print the output, or return a string or list of string from a function. A trailing newline, as well as extra interior whitespace that does not affect appear, is allowed.
This is code-golf, so shortest answer in bytes wins!
X
in the middle (part of why I added it) but who knows :D \$\endgroup\$