16
1
Write a program or function that takes in a positive integer and prints or returns an ASCII art depiction of an archery arrow, scaled according to the input.
If the input is 1
the output is
/\
/ \
\__/
||
||
||
||
||
||
||
||
/||\
/ || \
/ || \
// \\
/ \
If the input is 2
the output is
/\
/ \
/ \
/ \
\ /
\____/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
/| |\
/ | | \
/ | | \
/ | | \
/ | | \
/ |__| \
/ / \ \
/ / \ \
// \\
/ \
If the input is 3
the output is
/\
/ \
/ \
/ \
/ \
/ \
\ /
\ /
\______/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
/| |\
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ |____| \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
// \\
/ \
If the input is 4
the output is
/\
/ \
/ \
/ \
/ \
/ \
/ \
/ \
\ /
\ /
\ /
\________/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
/| |\
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ |______| \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
// \\
/ \
The pattern continues on for larger input numbers - the arrow is scaled up accordingly.
Notice that for any input N:
- The arrowhead is a pentagon with 2×N underscores at the base, N slashes on each of the sides extending from the base, and 2×N slashes on the two sides that form the arrow tip.
- The shaft (including the part within the fletching) consists of 11×N lines of two vertical bars separated by 2×(N-1) spaces. The very last line has underscores instead of spaces.
- The fletching surrounds the lower 3×N lines of the shaft. Two lines of 2×N slashes extend diagonally downward from either side of the shaft and are joined with vertical columns of slashes.
- The complete arrow is 16×N lines high and 6×N characters wide.
In your output there should be no empty lines before the arrow tip and only up to one trailing newline.
None of the output lines should have unnecessary leading spaces (the left edge of the fletching should be as leftmost as possible) but any of the lines may have any number of trailing spaces.
The shortest submission in bytes wins.
Is there a maximum input size? – Downgoat – 2015-08-14T03:41:21.457
1@vihan No. Though you can assume the numbers wont overflow your memory/integers. – Calvin's Hobbies – 2015-08-14T04:29:55.840
Should we worry about text wrapping? For N>=14, the default window size on my terminal makes my arrow look not like an arrow. – kevinsa5 – 2015-08-14T04:41:01.373
@kevinsa5 No. Don't worry. – Calvin's Hobbies – 2015-08-14T04:43:02.440