# 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

# Python 3, 91 86 bytes

n=range(int(input()))
for i in n:print(' '*i+'\\')
for i in n:print(' '*(n[-1]-i)+'/')


Try it online!

Edit 1: saved 5 bytes by making n a range instead of integer

• You can golf this a bit if you port this to Python 2 :) And there are definitely more optimizations you can make!
– RGS
Mar 25, 2020 at 19:00
• @RGS, Thanks! Don't really want to switch to python 2, but here is your port in 77 bytes Try it online!
– Dion
Mar 26, 2020 at 7:27
• 80 bytes
– Jo King
Aug 16, 2020 at 6:44
• Or even 73 bytes using exec
– Jo King
Aug 16, 2020 at 6:51
• 71 even if trailing spaces after \ are acceptable... Sep 11, 2020 at 14:42

# MATL, 1413 12 bytes

Xy92*t45-Pvc


1 Byte saved thanks to @LuisMendo

Explanation

        % Implicitly grab the input as an integer
Xy      % Create an identity matrix this size
92*     % Multiply by 92 (ASCII for '\')
t       % Duplicate the matrix
45-     % Subtract 45 from every element yielding 47 (ASCII for '/') on the diagonal
% and -45 everywhere else
P       % Vertically flip this matrix
v       % Vertically concatenate the two matrices
c       % Convert to characters (negative numbers are replaced with a space)
% Implicitly display the result


Try it out at MATL Online

# Vyxalj, 95 bitsv2, 11.875 bytes

ƛI\\JøṀ;½fyRṘJ


Try it Online!

Bitstring:

00001000000011101111110001100110011110111010010010110001001000111000011010000100001110000011111


Beats all non-canvas users

• Well it’s 14 SBCS which loses to MATL, and I can’t tell if the 10-byte Stax is using a canvas Feb 13 at 13:40
• stax has byte packing Feb 13 at 14:34
• So? That's not so different from vyncode Feb 13 at 15:27

# YASEPL, 58 bytes

=i=a'(1=b;space,i~>"\"!+}7,a2!-=b;space,i~>divide!}7,0,2


and just for fun...

# ibe, 118 bytes

adadadadadadaddsRafWmreafYmpeafUmtiakqskTagTmwakwafTmwslWssTmQmwaaYafQmwssQmRmqakeskTakrafTmwslWssTmQmraaUagQmwsaQmqme


(this is an esolang i made a while ago that i dont plan on releasing)

# Python 2, 63 bytes

f=lambda n,s='':n and f(n-1,~-n*' '+'\\\n'+s+~-n*' '+'/\n')or s


Try it online!

# Stax, 10 bytes

Ç₧¥╗M'gQ9⌂


Run and debug it

# SimpleTemplate, 100 bytes

This was quite a fun challenge, but some bugs in the language made it hard to optimize.

{@set_ argv.0}{@while_}{@callstr_repeat intoS" ",_}{@setO S,"\\\n",O,S,"/\n"}{@incby-1_}{@/}{@echoO}


Basically, cycles throught the values backwards, working the string from the middle out.

Due to the bugs, the code wasn't being interpreted properly.

This is how the code would be, if the compiler didn't had any bug (86 bytes):

{@forfrom argv.0to0step-1}{@callrepeat intoS" ",_}{@setO S,"\\
",O,S,"/
"}{@/}{@echoO}


Oh, well, at least the solution works :x

# JavaScript (Node.js), 42 bytes (If trailing new line is allowed)

n=>(F=s=>n--?s+\\
+F(s+" ")+s+/
:"")


Try it online!

# JavaScript (Node.js), 48 46 bytes

n=>(F=s=>s+\\
${--n?F(s+" ")+ :""}${s}/)


Try it online!

# Java 8, 80 bytes

n->{for(int i=0;i<2*n;)System.out.printf("%"+(i++<n?i:n-~n-i)+"c\n",i>n?47:92);}


Try it online.

Explanation:

n->{                    // Method with integer parameter and no return-type
for(int i=0;i<2*n;)   //  Loop i in the range [0, 2 * input n):
System.out.printf(  //   Print with format:
"%"+(i++<n?       //    If i is smaller than input n:
//    (and increase i by 1 right after this check with i++)
i           //     Use i leading spaces
:            //    Else:
n-~n-i)     //     Use 2 * n - i + 1 leading spaces
+"c\n",i>n?       //    If i is larger than input n:
47        //     Append a trailing '/' and newline
:          //    Else:
92);}     //     Append a trailing '\' and newline


# Japt-R, 15 bytes

"\\/"¬c@õ!ùX zY


Try it

õ!ù'\ cUÆ'/ ùU´


Try it

# Pyth, 23 bytes

V2VQ
+*?N--QH1H\ ?N\/\\


Try it online!

Note that the program must not have a terminating newline! If saving it on linux, you can remove the last byte in a file using head -c -1 <file>.

I think this is the first time I have used for loops in pyth? Anyways, this is a rather direct port of the example source code in the question (though the 2 loops are combined, and the innermost loop is converted into string multiplication, and the remaining 2 prints are joined into one).

# Batch File, 117 + 9 bytes

Executed using cmd/v/q/c.

for /l %%i in (1,1,%1)do (for /l %%j in (2,1,%%i)do set %%i= !%%i!)&echo !%%i!\
for /l %%i in (%1,-1,1)do echo !%%i!/


# Pyth, 18 bytes

js.e+R?k\/\\b_B*L;


Try it online!

# Python 3.8 (pre-release), 80 bytes

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


Try it online!

Same approach as the one I suggested to @Artemis Fowl, but takes advantage of the walrus operator.

# Swift 5/Xcode 10.2.1, 91 bytes

(0..<n*2).map{String(repeating:" ",count:$0<n ?$0:n*2-$0-1)+($0<n ?"\\":"/")+"\n"}.joined()


Try it online!

# Pepe, 91 bytes

rErEeEeEEEeeREeEREErereeereeERrEeeEeeeeeRrEeeeReereRerEEEererEeeEeEEEErEEEEREErereeereeERee


Try it online!

# Perl 5, 59 bytes

$_--;say$"x$_."\\"for(0..$_);say$"x$_."/"for(reverse 0..$_)  Example execution: perl -nE '$_--;say$"x$_."\\"for(0..$_);say$"x$_."/"for(reverse 0..$_)'


Waits for an integer to be provided on STDIN when executed. Once provided, it will display the arrow.

# Rockstar, 85 bytes

listen to N
X's0
while N-X
say " "*X+"\"
let X be+1

while X
let X be-1
say " "*X+"/"


Try it here (Code will need to be pasted in)

# Husk, 23 bytes

+mo:'\R' ŀ¹mo:'/R' ↔ŀ


Try it online!

There is probably a way to halve the size of this program.

# Forth (gforth), 72 bytes

: f dup 0 ?do i spaces 92 emit cr loop 1- for i spaces 47 emit cr next ;


Try it online!

there's probably a better way to do this.

/ \\()for a;<<<${(l:a:)0};\\ {1..$1};/ {$1..1}  Try it online! It really ought to be possible to get shorter than this... # J, 19 bytes ' \/'{~(,2*|.)@=@i.  Try it online! # JavaScript (Node.js), 59 bytes n=>eval("for(o='';s=''.padEnd(n--);)o=s+\\\\\n${o+s}/\n")


Attempt This Online!

I had a different idea, it didn't turn out as golfy as the obvious method but I still felt like posting it.

The program constructs the string with a for loop, counting down from n, and continuously sets a string o to: n spaces, backtick, newline, o, n spaces, forward slash, newline.

# Go, 133 bytes

import."strings"
func f(n int)(o string){for i:=0;i<n;i++{o+=Repeat( ,i)+"\\\n"}
for i:=n;i>0;i--{o+=Repeat( ,i-1)+"/\n"}
return}


Attempt This Online!

# Go 1.22+, 131 bytes

import."strings"
func f(n int)(o string){for i:=range n{o+=Repeat( ,i)+"\\\n"}
for i:=range n{o+=Repeat( ,n-i-1)+"/\n"}
return}


You cannot Attempt This Online!

Run it on the Go Playground!

# Perl 5 + -p, 20 bytes

Uses non-printable characters (backspace 0x08 and form feed 0x0c) to position the characters in the terminal.

$_='\.'x$_."./.."x$_ Try it online! ## Explanation Stores in $_ a repetition of the literal string \<FF> $_ (implicit input) times, concatenated with <BS>/<FF><BS> repeated $_ times.

\$_ is then output implicitly by -p.