# 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.
• Are you sure this is not a duplicate (that is, did you sandbox this)? I think this is likely to be, but it's slightly nearly impossible to search for. Jun 9, 2019 at 4:46
• 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

# 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.

# Zsh, 46 bytes

/ \\()for a;<<<${(l:a:)0};\\ {1..$1};/ {\$1..1}


Try it online!

It really ought to be possible to get shorter than this...