# Specifications

Given a number n, output an ASCII "meme arrow" (greater-than symbol, >) of size n.

n will always be a positive integer, greater than 0.

## Examples

n = 2

\
\
/
/


n = 5

\
\
\
\
\
/
/
/
/
/


# Sample code

Here is a sample program, written in Crystal, that returns the correct results. Run it as ./arrow 10.

arrow.cr:

def f(i)
i.times { |j|
j.times { print ' ' }
puts "\\"
}
i.times { |j|
(i-j-1).times { print ' ' }
puts '/'
}
end

f(ARGV[0].to_i)


# Rules

• This is . The shortest answer wins. However, I will not select an answer, because the shortest answer may change over time.
• Standard loopholes are not allowed.
• I think it's pretty silly to call this common symbol a "meme arrow". They're obviously comedy chevrons. Jun 10, 2019 at 18:04
• @Christian They're actually amusing angles Jun 10, 2019 at 20:39
• @ArtemisFowl I thought they were interesting increases Jun 12, 2019 at 22:17
• @dkudravtsev Not silly signage? Jun 12, 2019 at 22:19
• > Is me > Challenge about meme arrows exists > Writes comment using meme arrows because it's ironic > No one reads comment > Frick Oct 7, 2020 at 3:09

# Canvas, 2 bytes

＼═


Try it here!

• Code itself is like smile actually. Jun 9, 2019 at 20:14

# C (gcc), 56 bytes

f(n,i){for(i=-n;n;printf("%*c\n",i?++i+n:n--,i?92:47));}


Try it online!

f(n,i){for(i=-n;i;printf("%*c\n",  ++i+n    ,  92   ));     //first print descending '\'s
for(    ;n;printf("%*c\n",        n--,     47));}    // then print returning  '/'s


# Python 2, 54 bytes

f=lambda n,p='':n*'?'and p+'\\\n'+f(n-1,p+' ')+p+'/\n'


Try it online!

Outputs with a trailing newline.

# C# (Visual C# Interactive Compiler), 66 bytes

n=>new int[n*2].Select((a,b)=>"".PadLeft(b<n?b:n*2+~b)+"\\/"[b/n])


Saved a byte thanks to @someone.

Try it online!

• n*2-b-1 -> n*2+~b Jun 9, 2019 at 4:57

# Perl 5-p, 36 bytes

$\=($q=$"x$_)."\\
${S}/:""  Try it at the TypeScript playground Takes input as a unary number represented by a tuple type N. If I instead took the unary number as a string type of spaces, this becomes 71 bytes: type F<S,O=''>=S extends${infer S}?F<S,${S}\\${O&string}${S}/ >:O  Try it at the TS playground I like the shorter version better because it's tail-recursive and just overall really elegant, but I think the I/O format is a little cheaty. # Vyxal, 8 bytes ɾ\\↳↲øṀ§  Try it Online!  ↳ # Right-pad \\ # \ ɾ # To length each of range(1, n+1) ↲ # Left-pad each to length n øṀ # Mirror, flipping slashes § # Vertical join, transposing and joining by newlines  # Retina 0.8.2, 32 bytes .+$* ¶$&$*
\G.
¶$\ r.\G$'/¶


Try it online! Explanation:

.+
$* ¶$&$*  Generate two lines of n spaces. \G. ¶$\


Turn the top line into a \ diagonal.

r.\G
$'/¶  Turn the bottom line into a / diagonal. # C (gcc), 67 65 bytes -2 bytes thanks to ceilingcat f(n,i){for(i=~n;i++<n;)i&&printf("%*c\n",n-abs(i)+1,"/\\"[i<0]);}  Try it online! # Python 2, 85848180 75 bytes def a(n):l="for i in range(n):print' '*";exec l+"i+'\\\\'\n"+l+"(n+~i)+'/'"  Try it online! • -1 with r-strings: def a(n):l="for i in range(n):print' '*";exec l+r"i+'\\'\n"+l+"(n+~i)+'/'" Apr 22, 2021 at 20:43 • @Makonede Leads to a SyntaxError unfortunately :( Apr 23, 2021 at 7:19 • Ah, maybe r-strings weren't a thing in Python 2. Oh well. Apr 23, 2021 at 15:33 • They were, but the \n can't be in a raw string even in Python 3. Apr 23, 2021 at 16:02 # PowerShell, 50 bytes param($n)0..--$n|%{' '*$_+'\'}
$n..0|%{' '*$_+'/'}


Try it online!

Will look into making it so it only goes through the range once. Not bad for the no brain method though.

# Twig, 115 bytes

Builds the string backwards, "returning" it in the end.

Uses a macro to generate all the results.

{%macro a(N,s="")%}{%for i in N..1%}{%set s=('%'~i~'s
'~s~'%'~i~'s
')|format('\\','/')%}{%endfor%}{{s}}{%endmacro%}


This macro has to be in a file, and imported like this:

{% import 'macro.twig' as a %}

{{ a.a(<value>) }}


You can try it on https://twigfiddle.com/5hzlpz (click on "Show raw result").

-3 bytes thanks to Sriotchilism O'Zaic.

unlines.g
g 0=[]
g n="\\":map(' ':)(g$n-1)++["/"]  Try it online! • You can save a byte with g$n-1 instead of g(n-1). You also don't need to count the f= since f never gets referenced. Jun 10, 2019 at 15:53

# Pyth, 19 bytes

VQ+*dN\\)V_Q+*dhN\/


Try it online!

TIL multiplying a string by a negative value multiplies it by its absolute value.

# Python 3, 90 83 bytes

lambda n:'\n'.join([' '*i+'\\'for i in range(n)]+[' '*(n+~i)+'/'for i in range(n)])


Try it online!

-7 bytes thanks to @squid

• 83 bytes, but I feel like it can still go down Jun 13, 2019 at 12:55
• I wish this was possible. Jun 13, 2019 at 14:45
• Soon... Jun 13, 2019 at 14:50
• Oh yeah I forgot about that. Maybe you should submit it! Jun 13, 2019 at 14:54

# Rockstar, 133 bytes

Try it online here!

F takes N,S
If N is 0
Give back N

Say S+"\"
Let T be S+" "
Let M be N-1
F taking M,T
Say S+"/"

Listen to X
F taking X,""


Since Rockstar is not famous for string operations, it takes relatively lots of code to do it (recursively was even longer).

The size of the arrow is taken as input.

# PHP, 7963 61 bytes

function f($x,$s=''){if($x)echo"$s\\
",f($x-1,"$s "),"$s/ ";}  Try it online! Recursive in PHP. ### -12 bytes by @manatwork • Better count down. Try it online!. Jun 17, 2019 at 19:05 • @manatwork very very nice! Jun 17, 2019 at 19:11 # \/\/>, 74 bytes jp100o -84*}!o:?!x1 @+:q:p=?x:o~$:0(pa"\/"q?$~}}: x2-:p$1-y$:0(? .{suh?!;2  Explanation: (lines rotated based on start point) jp100o //setup :?!x1-84*}! //add leading spaces, loop and decrement until 0 ~$:0(pa"\/"q?$~}}:@+:q:p=?x:o //add correct slash, go back to loop or switch sides$:0(?x2-:p\$1-y                //flip direction state or continue to print
{suh?!;2.                     //remove extra data and print stack

• \/\/> (pronounced wɜrm) Thanks, I hate it. (jk, I'm looking forward to giving it a try)
– Jo King
Jul 5, 2019 at 6:39
• @JoKing hahaha, gotta wear my inspiration on my sleeve. (thanks!) Jul 5, 2019 at 6:42

# Python 3, 55 bytes

f=lambda n,i="":n and i+"\\\n"+f(n-1,i+" ")+i+"/\n"or""


Try it online!

• Oct 15, 2019 at 0:27

# Erlang (escript), 69 bytes

r(0,_)->"";r(I,X)->X++"\\\n"++r(I-1,X++" ")++X++"/\n".