g | x | w | all
Bytes Lang Time Link
036Raku Perl 6 rakudo250417T174207Zxrs
080AWK250407T220242Zxrs
024Vyxal220527T033412ZnaffetS
054///210323T170546ZSamuel W
046GolfScript210323T165331ZSamuel W
071Excel VBA171004T142629ZTaylor R
02205AB1E210321T192003ZMakonede
022Canvas210321T055209Zhakr14
028Pyth210321T054042Zhakr14
130CSASM v2.1.2.3210321T041136Zabsolute
076x86_16 machine code210317T002415ZFebriyan
020Stax210317T024530ZRazetime
nanJ171028T031301ZJonah
073PHP171028T070931ZJo.
037Perl 5170920T212340ZXcali
039Ruby171027T185542ZJordan
067bash171027T115533ZNahuel F
025Charcoal171027T111552ZNeil
023Jelly171004T141812ZSherlock
030Actually171004T134351ZSherlock
037Retina171004T125529Ztotallyh
025Charcoal170920T213837Ztotallyh
090R170926T214904ZGiuseppe
032Jelly170926T212723Zsporkl
043MATL170921T164656ZCinaski
088AsciiDots170924T213226Zuser3141
018SOGL V0.12170920T192155Zdzaima
109Batch170923T011228Zstevefes
023Japt170921T013010ZETHprodu
048QBIC170921T163055Zsteenber
057PowerShell170920T205422Zroot
062C# .NET Core170921T015724Zthe defa
038Retina170921T114008ZMartin E
074SpecBAS170921T110415ZBrian
060Excel170921T103545ZWernisch
073C# .NET Core170920T201725ZIan H.
076Java 8170921T075541ZKevin Cr
033Pip170921T033920ZDLosc
082C gcc170920T203948Zcleblanc
053Haskell170920T205423Znimi
02605AB1E170920T203232ZEmigna
045Retina170920T203944Zmbomb007
031Pyth170920T200424ZJakube
03805AB1E170920T200231ZRiley
040Pyth170920T194801Zuser4854
048Python 3170920T192344ZMr. Xcod
047Python 2170920T192943Zlynn
060JavaScript ES6170920T193921ZJustin M
046Pyth170920T193456ZSteven H
049Actually170920T192742Zuser4594

Raku (Perl 6) (rakudo), 36 bytes

{'  ^
 / '~'\
| | |
 \ 'x$_~'/
  V'}

Attempt This Online!

AWK, 80 bytes

{s="  ^\n / \\\n";for(c=(a="| | |\n")" \\ \\\n";++i<$1;)s=s c}$0=s a" \\ /\n  v"

Attempt This Online!

{s="  ^\n / \\\n"; # initialize string to top point 
for(c=             # create a block of two lines
(a="| | |\n")      # first line
" \\ \\\n";        # second line
++i<$1;)           # while less than input
s=s c}             # append block to string
$0=s               # set output to string
 a                 # append end  | | |
" \\ /\n  v"       # with bottom point

Vyxal, 24 bytes

`\||`∞*` ^ /`p`/ v`JṄ5ẇ⁋

Try it Online!

///, 54 bytes

/*/
| | |
b//b>///b/ \\\\ \\\\/  ^
 \/ \\**> \\ \/
  v

Try it online!

For input, change the number of asterisks

 \/ \\**> \\ \/ 
      ^^

GolfScript, 46 bytes

~['
| | |
']*' \\'2**' \\ /
  v'+
'  ^
 / \\'\

Try it online!

Excel VBA, 71 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

05AB1E, 22 bytes

…\||û×" ^ /ÿ/ v"Sðý5ô»

Try it online!

…\||û×" ^ /ÿ/ v"Sðý5ô»  # full program
                     »  # split...
      " ^ /ÿ/ v"        # literal...
                        # (implicit) with ÿ replaced by...
…\||                    # literal...
    û                   # concatenated with...
…\||                    # literal...
    û                   # reversed excluding the first character...
     ×                  # repeated...
                        # implicit input...
     ×                  # times...
                  ý     # with each...
                S       # character...
                  ý     # joined by...
                 ð      # spaces...
                     »  # into rows...
                    ô   # of length...
                   5    # literal
                        # implicit output

Canvas, 22 bytes

| | |¶\ \*k^¶/ \:↕└∔∔r

Try it here!


Explanation:

Code                       # Explanation               # Stack visualization
#############################################################################################
                           # Stack starts with input   # <input>
| | |¶\ \                  # Push string literal       # <input>, | | |¶\ \
         *                # Repeat vertically n times # | | |¶\ \...| | |¶\ \
           k              # Remove last line          # | | |¶\ \...| | |
             ^¶/ \         # Push string literal       # | | |¶\ \...| | |, ^¶/ \
                  :       # Duplicate TOS             # | | |¶\ \...| | |, ^¶/ \, ^¶/ \
                    ↕      # Mirror vertically         # | | |¶\ \...| | |, ^¶/ \, \ /¶v
                     └     # Swap 2nd and 3rd in stack # ^¶/ \, | | |¶\ \...| | |, \ /¶v
                      ∔    # Add vertically            # ^¶/ \, | | |¶\ \...| | |¶\ /¶v
                       ∔   # Add vertically            # ^¶/ \¶| | |¶\ \...| | |¶\ /¶v
                        r # Center each line          #   ^¶ / \¶| | |¶ \ \...| | |¶ \ /¶  v
                           # Print TOS                 #

represents a newline in the stack visualization.

Pyth, 28 bytes

jcjd++" ^ /"*Q"\|||\\""/ v"5

Test suite

Translation of Sherlock9's Jelly answer.

CSASM v2.1.2.3, 130 bytes

By far the shortest answer I'll submit with this language. (Probably)
Hooray for builtins!

func main:
in ""
conv i32
pop $a
push "  ^\n / \\\n| | |\n"
push " \\ \\\n| | |\n"
push $a
push 1
sub
mul
add
push " \\ /\n  v"
add
print
ret
end

Commented and ungolfed:

func main:
    ; Get the input, convert it to an integer and store it in the accumulator
    in ""
    conv i32
    pop $a

    ; Push the first three rows of the chain
    push "  ^\n / \\\n| | |\n"

    ; Push the next two rows of the chain
    push " \\ \\\n| | |\n"

    ; Duplicate those two rows ($a - 1) times
    push $a
    push 1
    sub
    mul

    ; Append the duplicated rows to the first three rows
    add

    ; Push the final 2 rows
    push " \\ /\n  v"

    ; Append them
    add

    ; Print the result string on the stack
    print
    ret
end

x86_16 machine code - 76 bytes

8B CB         MOV CX, BX
49            DEC CX
B4 09         MOV AH, 09H 
           ATAS:
BA 02 01      MOV DX, OFFSET RANTAI_S_1
CD 21         INT 21H
85 C9         TEST CX, CX
74 09         JE BAWAH   
          .LOOP:
BA 15 01      MOV DX, OFFSET RANTAI_LOOP
CD 21         INT 21H
E3 02         JCXZ BAWAH
E2 F7         LOOP .LOOP           
          BAWAH:
BA 23 01      MOV DX, OFFSET RANTAI_S_2
CD 21         INT 21H           
          EXIT:
B8 00 4C      MOV AX, 4C00H
CD 21         INT 21H 

RANTAI_S_1      DB 020H, 020H, 05EH, 00AH, 00DH, 020H, 02FH, 020H, 05CH
                DB 00AH, 00DH, 07CH, 020H, 07CH, 020H, 07CH, 00AH, 00DH
                DB 024H 

RANTAI_LOOP     DB 020H, 05CH, 020H, 05CH, 00AH, 00DH, 07CH, 020H, 07CH
                DB 020H, 07CH, 00AH, 00DH, 024H 

RANTAI_S_2      DB 020H, 05CH, 020H, 02FH, 00AH, 00DH, 020H, 020H, 076H
                DB 024H 

Tested on DOSBox

enter image description here

enter image description here

enter image description here

Stax, 21 20 bytes

⌐èüYΩ╜yu╝√♪╪▌yº⌐▌2Σ⌠

Run and debug it

Uses ETHProductions' idea.

-1 after changing 1/ to M (from recursive).

J, 51 50 48 bytes

'  v',~'  ^','/'(0 1;_1 3)}' \ \ | | |'$~5,~1++:

Try it online!

PHP, 73 bytes

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

Try it online!

Perl 5, 39 37 bytes

say"  ^
 / ".'\
| | |
 \ 'x<>."/
  v"

Try it online!

Shaved two bytes with @DomHastings' suggestion

Ruby, 39 bytes

->n{"  ^
 / #{"\\
| | |
 \\ "*n}/
  v"}

Try it online!

bash, 67 bytes

printf -v a %\*s $1 \ ;echo '  ^
 / '"${a// /\\
| | |
 \\ }"'/
  v'

Try it online

Charcoal, 25 bytes

↘^\¶/¶G→⁵↓⊕⊗N←⁵|¶ \↗¶\¶v/

Try it online! Link is to verbose version of code.

Jelly, 25 23 bytes

This works on the same principle as ETHproductions's Japt answer, where extra spaces are added later, and the whole string is split into strings of length 5 before printing. Try it online!

Edit: I knew there was a way to join the top and bottom of the S-chain in a golfier way. Thanks to Erik the Outgolfer for -2 bytes.

“\|||\”ẋ“ ^ /“/ v”jKs5Y

Ungolfing

                Left argument: n
“\|||\”ẋ        Repeat the middle portion n times.
“ ^ /“/ v”j     Append the top and bottom.
K               Join with spaces.
s5              Split into a list of length-5 strings.
Y               Print the strings with linefeeds.

Actually, 30 bytes

This works on the same principle as ETHproductions's Japt answer, where extra spaces are added later, and the whole string is split into rows of 5 for implicit printing. Try it online!

"\|||\"*" ^ /"+"/ v"@+#' j5@╪i

Ungolfing

            Implicit input.
"\|||\"*    Add the middle portion and multiply that by the input.
" ^ /"+     Append the top.
"/ v"@+     Append the bottom.
#           Convert into a list of strings
' j         Join with spaces.
5@╪         Split into a list of length-5 strings.
i           Flatten list onto the stack for implicit printing with newlines.

Retina, 37 bytes

.*
$*
1
\¶| | |¶ \ 
^
  ^¶ / 
$
/¶  v

Try it online!

I must be missing something, this is a super basic approach...

Charcoal, 27 26 25 bytes

-1 byte thanks to Carlos Alejo. -1 byte thanks to ASCII-only.

  ^⸿ / ×\⸿| | |⸿ \ N/⸿  v

Try it online! Link is to verbose version. #charcoal-verbose-obfucation

R, 90 bytes

function(n){cat('  ^
 / \\
| | |
')
for(i in 2:n-1)cat(' \\ \\
| | |
')
cat(' \\ /
  v
')}

Try it online!

pretty lame, but this is the best we've got to work with in R.

Jelly, 32 bytes

Boring port of Lynn's Python solution.

“\¶| | |¶ \ ”ẋṭ“  ^¶ / ”;“/¶  v”

Try it online!

Explanation:

“\¶| | |¶ \ ”ẋṭ“  ^¶ / ”;“/¶  v”    Example input: 5
“\¶| | |¶ \ ”                       Literal string "\¶| | |¶ \ " (¶ = newline). Result: "\¶| | |¶ \ "
             ẋ                      Repeat as many times as the (implicit) input. Result: "\¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ "
              ṭ                     Tack that on the end of...
               “  ^¶ / ”            ...the string "  ^¶ / ". Result: "  ^¶ / \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ "
                        ;           Append...
                         “/¶  v”    The string "/¶  v". Result: "  ^¶ / \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ /¶  v"
                                    Implicit print

MATL, 47 44 43 bytes

-3 bytes thanks to Giuseppe

'  ^' ' / \ 'XK'| | |'XJGq:"' \'thJ]KP'  v'

Try it online!

AsciiDots, 88 bytes

.*$"  ^"$" / \"
/>#?)--*$"| | |"$" \ \"
*#1\ /-~$"| | |"$" \ /"$"  v"
*-{-}*[<]
\#0----/

Try it online!

SOGL V0.12, 26 25 18 bytes

°I-‘*"∑ūCƨΩ)¹‘@∑5n

Try it Here!

Uses the same strategy as ETHproductions's Japt answer

Explanation:

..‘           push "\|||\"
   *          repeat input times
    "..‘      push " ^ /ŗ/ v ", with ŗ replaced with POP. The reason why there's a trailing
              space is because otherwise it didn't have enough repeating characters to compress
        @∑    join with spaces
          5n  split to line lengths of 5

Batch, 109 bytes

I believe this isn't completely golfed yet.

@echo   ^^
@echo  / \
@for /l %%G in (2,1,%1)do @echo ^| ^| ^|&@echo  \ \
@echo ^| ^| ^|
@echo  \ /
@echo   v

This script just:

Japt, 34 25 23 bytes

" ^ /{ç'\²i|³1}/ v"¬¸ò5

Test it online! Outputs as an array of lines; -R flag added to join on newlines. (Thanks @Shaggy)

First Second attempt, might be improvable...

How it works

" ^ /{ ç'\²  i |³  1}/ v"¬ ¸  ò5
" ^ /{Uç'\p2 i'|p3 1}/ v"q qS ò5   Ungolfed
                                   Implicit: U = input number
        '\p2                       Repeat a backslash twice, giving "\\".
             i     1               Insert at index 1
              '|p3                   3 vertical bars. This gives "\|||\".
      Uç                           Make U copies of this string. U = 2: "\|||\\|||\"
" ^ /{              }/ v"          Insert this into this string.    " ^ /\|||\\|||\/ v"
                         q qS      Split into chars; join on spaces."  ^   / \ | | | \ \ | | | \ /   v"
                              ò5   Split into rows of length 5.    ["  ^  "," / \ ","| | |"," \ \ ","| | |"," \ / ","  v"]
                                   Joining on newlines gives "  ^  
                                                               / \ 
                                                              | | |
                                                               \ \
                                                              | | |
                                                               \ /
                                                                v"

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
                    B$ holds " / \ ", which reversed is " \ / "
?@  v`          and print "  v"
\           ELSE
?@ \ \          print the connector to the next section
The final string lit, the IF and the FOR are auto-closed at EOF

PowerShell, 83, 57 bytes

"  ^
 / \"
1..--$args[0]|%{"| | |
 \ \"}
"| | |
 \ /
  v"

Try it online!

Per @AdmBorkBork's suggestions,

C# (.NET Core), 73 69 66 64 62 bytes

Two less bytes and perl-like appearance thanks to Barodus. Didn't think of using int? for nulls.

n=>$@"  ^
 / {string.Join(@"\
| | |
 \ ",new int?[++n])}/
  v"

Try it online!

Retina, 38 bytes

.+
$*
1
¶|||¶x\\
^
 ^¶x/\
.$
/¶ v
x?
 

Try it online!

Prints a column of leading spaces and on trailing space on each line.

Explanation

The main byte savings come from omitting the spaces in all the literal parts and inserting them at the end. The figure is structured such that there are never two non-spaces next to each other, so if we just remove them all, we can almost fix the shape by inserting a space at every position at the end:

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

becomes:

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

That's almost correct, except for indentation. The ^ and v are missing two spaces. That's actually easier to fix, because if we just insert an explicit space in front of each of them, that'll result in two additional spaces at the end. The lines with the slashes are trickier because they require just one additional space. To fix this, we insert a placeholder character there (x). When we insert the spaces at the end, we don't just insert them for every empty match, but we optionally match that x. That means instead of inserting a space in front of the x, the x itself gets replaced. And then there will still be an empty match right after the x. That means, every x adds exactly one space without changing anything else. So what we want to set up is this:

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

which will give us the desired result. So here's the code:

.+
$*

Convert the input to unary.

1
¶|||¶x\\

Convert each 1 to two lines with ||| and x\\ (and a leading linefeed).

^
 ^¶x/\

Inser the first two lines with ^ and x/\.

.$
/¶ v

Fix the final x\\ by turning the last \ into / and appending a line with the v.

x?
 

Replace each x or empty match with a space.

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.

Excel, 60 bytes

="  ^
 / \
"&REPT("| | |
 \ \
",A1-1)&"| | |
 \ /
  v"

C# (.NET Core), 101 77 73 bytes

Saved 24 bytes thanks to i cri everytim!
Saved 4 bytes thanks to Kevin Cruijssen!

n=>{var s="  ^\n / ";for(;n-->0;s+="\\\n| | |\n \\ ");return s+"/\n  v";}

Try it online!

As per usual, string repeating in C# is a pain.

Java 8, 93 76 bytes

n->{String r="  ^\n / ";for(;n-->0;r+="\\\n| | |\n \\ ");return r+"/\n  v";}

Port of @IanH.'s C# .NET answer after I golfed it a bit more.

Try it here.

Pip, 45 42 33 bytes

"  ^
 / "."\
| | |
 \ "Xa."/
  v"

Try it online!

Explanation

The code is really simple, though the newlines make it harder to read. Here's a better way to see the structure:

"prefix" . "repeated" X a . "suffix"

The repeated element in the S-chain is

   \
| | |
 \

Take this as a literal string and repeat it a times (where a is the first command-line argument). Then prepend the prefix:

  ^
 /

and append the suffix:

   /
  v

and print.

(I like how this ended up looking kinda like a ><> program.)

C (gcc), 82 bytes

f(n){for(puts("  ^\n / \\");--n;puts("| | |\n \\ \\"));puts("| | |\n \\ /\n  v");}

Try it online!

Haskell, 53 bytes

f n="  ^\n /"++([1..n]>>" \\\n| | |\n \\")++" /\n  v"

Try it online!

05AB1E, 27 26 bytes

…^
/ð"\
| | |
\ "I×…/
vJ.c

Try it online!

Alternate 27 byte version

'^…/ \©IF…| |û…\ \}\®R'v».c

Try it online!

Explanation

'^                             # push "^"
  …/ \©                        # push "/ \" and store a copy in register
       IF                      # input times do:
         …| |û                 # push "| | |"
              …\ \             # push "\ \"
                  }            # end loop
                   \           # discard top of stack (the extra "\ \")
                    ®R         # push "/ \" reversed = "\ /"
                      'v       # push "v"
                        »      # join stack on newlines
                         .c    # center each row

Retina, 45 bytes

This is a pretty simple solution.

.+
$*
^1
  ^¶ /x
$
 \ /¶  v
1
 \x
x
 \¶| | |¶

Try it online

If the art could be 1-indexed instead, it'd be a bit shorter (44 bytes):

.+
  ^¶ /x$0$*1
$
 \ /¶  v
1
 \x
x
 \¶| | |¶

Pyth, 33 32 31 bytes

Thanks Mr. Xcoder for one byte.

%"  ^
 / %s/
  v"*tj\|_B" \\
| 

Try it online: Demonstration or Test Suite

05AB1E, 38 bytes

…| |ûU"  ^
 / \"XI<F„ \2×X}" \ /
  v"»

Try it online!

…| |                         # Push "| |"
    û                        # Palindromize
     U                       # Store in X
      "..."X                 # Push the top three rows
            I<F      }       # One less than input times do:
               „ \           #   Push " \"
                  2×         #   Concatenate that with itself
                    X        #   Push "| | |"
                      "..."  # Push the last two rows
                           » # Join stack with newlines

Pyth, 40 bytes

K" / \ ""  ^"Kj+b+*2+d\\b*Q]*3"| "_K"  v

Fairly similar to Steven Hewitt's, but developed independently.

Try it Online

Explanation

K" / \ ""  ^"Kj+b+*2+d\\b*Q]*3"| "_K"  v
K" / \ ""                                 Set K = " / \ "
        "  ^"                       "  v  Draw the end points.
             K                    _K      Draw the slants.
                         *Q]*3"| "        Draw the vertical bars...
              j+b+*2+d\\b                 ... interspersed with slants.

Python 3, 48  56 59 61  bytes

lambda k:'  ^\n / %s/\n  v'%('\\\n| | |\n \ '*k)

Try it online!

Python 2, 47 bytes

lambda k:'  ^\n / '+'\\\n| | |\n \ '*k+'/\n  v'

Try it online!

JavaScript (ES6), 60 bytes

n=>`  ^
 / \\
${`| | |
 \\ \\
`.repeat(n-1)}| | |
 \\ /
  v`

Test Snippet

let f=
n=>`  ^
 / \\
${`| | |
 \\ \\
`.repeat(n-1)}| | |
 \\ /
  v`
;(I.oninput=_=>O.innerHTML=I.value+"\n"+f(+I.value))()
<input id=I type=range min=2 max=15 value=2><pre id=O></pre>

Pyth, 46 bytes

"  ^
 / \\"
+*j[jd*\|3" \ \\"k))Q" \ /
  v

Test suite.

Actually, 49 bytes

"| | |"@α;lD" \ \"@α@Z♂ii"  v"" \ /"))" / \""  ^"

Try it online!

Explanation:

"| | |"@α;lD" \ \"@α@Z♂ii"  v"" \ /"))" / \""  ^"
"| | |"@α                                          push a list containing n copies of the vertical lines
         ;lD" \ \"@α                               push a list containing n-1 copies of the diagonal connections
                    @Z♂i                           interleave
                        i                          flatten
                         "  v"" \ /"))             make the bottom
                                      " / \""  ^"  make the top