# Background

When I was younger, I was taught a method of drawing a weird "S" shape, that I (along with my classmates) found fascinating. Today, I rediscovered it, and due to its formulaic approach to drawing it, thought it could lead to an interesting challenge :P

# Drawing the "S"

The S can be drawn by following these simple steps:

First, draw 2 rows of three vertical lines like so

| | |

| | |


Next, connect the top left line with the bottom middle line and the top middle with the bottom right line to produce

| | |
\ \
| | |


Finally, draw a top and bottom on the currently drawn image so that it ends up looking like

  ^
/ \
| | |
\ \
| | |
\ /
v


As you can see, this results in an "S" shape. When extended however (drawing it with more than 2 rows), it produces a very interesting pattern. Your task is reproduce this interesting pattern.

Given an integer where n >= 2, output The S with n rows to be made from it. Output may be returned from a function, and input may be taken in standard methods. Trailing/leading whitespace for both the overall image, as well as each line, is fine. However, leading line spaces must be consistent so that the " isn't broken. You may output as a list of lines.

# Test cases

input
output
---

2

^
/ \
| | |
\ \
| | |
\ /
v

---

8
^
/ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ /
v

---

10

^
/ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ \
| | |
\ /
v


This is a so shortest code wins! Good luck,

• Wikipedia calls the S the Cool S, and calls an infinite version of the an S Chain – Stephen Sep 20 '17 at 19:16
• Can we output as a list of lines? – Mr. Xcoder Sep 20 '17 at 19:17
• @Mr.Xcoder you may – caird coinheringaahing Sep 20 '17 at 19:17
• @Stephen 10 minutes googling and this didn't come up. I'll edit the name of the question – caird coinheringaahing Sep 20 '17 at 19:18
• @cairdcoinheringaahing I searched images, that might have been it :P – Stephen Sep 20 '17 at 19:19

# SpecBAS - 74 bytes

1 INPUT n
2  ?"  ^"'" / \"'("| | |"#13" \ \"#13)*(n-1);"| | |"'" \ /"'"  v"


Apostrophe moves to next line, but doesn't work inside the string being repeated, so have to use #13 to insert line feeds in that part.

# QBIC, 48 bytes

?@  ^?@ / \ [:|?@| | |~a=b|?_fB|?@  v\?@ \ \


## Explanation

Note that every '?' inserts a linebreak
Also note that @... creates a string literal and assigns that to A$, B$, ... Z$?@ ^ print ^ prefixed with 2 spaces ?@ / \  print the other start bit, pre- and postfixed with spaces [:| FOR a = 1 to (chain-length given as cmd line param, read as 'b') ?@| | | PRINT the pipes ~a=b| IF we are in the last iteration THEN ?_fB| print the reversed of B$
_f...| flips a string
1
\¶| | |¶ \
^
^¶ /
$/¶ v  Try it online! I must be missing something, this is a super basic approach... • You did only outgolf Martin by 1 byte, so you probably aren't missing something – caird coinheringaahing Oct 4 '17 at 12:57 # Excel VBA, 72 Bytes Anonymous VBE immediate window function that takes input from cell A1 and outputs to the VBE immediate window a="| | |":?" ^":?" / \":For i=2To[A1]:?a:?" \ \":Next:?a:?" \ /":?" v"  # Ruby, 39 bytes ->n{" ^ / #{"\\ | | | \\ "*n}/ v"}  Try it online! # J, 51 bytes ' v',~' \ /',~' ^',' / \',[:}:'| | | \ \ '$~5,~+:


Try it online!

# PHP, 73 bytes

<?='  ^
/ \
'.join('
\ \
',array_fill(0,\$argv[1],'| | |')).'
\ /
v';
`

Try it online!