Skip to main content
added 214 characters in body
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88

V, 18 1717 16 bytes

1 byte saved thanks to @nmjcman101 for using another way of outputting nothing if the input is 0

Àñé\é|hñÀñÙáé\é|ÀñÙá ñÒ-xxÀ«D 

Try it online!Try it online!

Hexdump:

00000000: e95c e97c c0f1 d9e1 20f1 d22d 78c0 ab44 .\.|.... ..-x..D 

###Explanation (outdated)

We first have a loop to check if the argument is 0. If so, the code below executes (|\ is written). Otherwise, nothing is written and the buffer is empty.

Àñ ñ " Argument times do: é\é| " Write |\ h " Exit loop by creating a breaking error 

Now that we got the top of the triangle, we need to create its body.

Àñ ñ " Argument times do: Ù " Duplicate line, the cursor comes down à<SPACE> " Append a space 

Now we got one extra line at the bottom of the buffer. This has to be replaced with -s.

Ó- " Replace every character with a - x " Delete the extra '-' 

This answer would be shorter if we could whatever we want for input 0

V, 14 13 bytes

é\é|ÀñÙá ñÒ-x 

Try it online!

V, 18 17 bytes

Àñé\é|hñÀñÙá ñÒ-x 

Try it online!

###Explanation

We first have a loop to check if the argument is 0. If so, the code below executes (|\ is written). Otherwise, nothing is written and the buffer is empty.

Àñ ñ " Argument times do: é\é| " Write |\ h " Exit loop by creating a breaking error 

Now that we got the top of the triangle, we need to create its body.

Àñ ñ " Argument times do: Ù " Duplicate line, the cursor comes down à<SPACE> " Append a space 

Now we got one extra line at the bottom of the buffer. This has to be replaced with -s.

Ó- " Replace every character with a - x " Delete the extra '-' 

This answer would be shorter if we could whatever we want for input 0

V, 14 13 bytes

é\é|ÀñÙá ñÒ-x 

Try it online!

V, 18 17 16 bytes

1 byte saved thanks to @nmjcman101 for using another way of outputting nothing if the input is 0

é\é|ÀñÙá ñÒ-xÀ«D 

Try it online!

Hexdump:

00000000: e95c e97c c0f1 d9e1 20f1 d22d 78c0 ab44 .\.|.... ..-x..D 

###Explanation (outdated)

We first have a loop to check if the argument is 0. If so, the code below executes (|\ is written). Otherwise, nothing is written and the buffer is empty.

Àñ ñ " Argument times do: é\é| " Write |\ h " Exit loop by creating a breaking error 

Now that we got the top of the triangle, we need to create its body.

Àñ ñ " Argument times do: Ù " Duplicate line, the cursor comes down à<SPACE> " Append a space 

Now we got one extra line at the bottom of the buffer. This has to be replaced with -s.

Ó- " Replace every character with a - x " Delete the extra '-' 

This answer would be shorter if we could whatever we want for input 0

V, 14 13 bytes

é\é|ÀñÙá ñÒ-x 

Try it online!

added 781 characters in body
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88

V, 1818 17 bytes

Àñé\é|hñÀñÙá ñVrñÒ-x 

Try it online!Try it online!

###Explanation

We first have a loop to check if the argument is 0. If so, the code below executes (|\ is written). Otherwise, nothing is written and the buffer is empty.

Àñ ñ " Argument times do: é\é| " Write |\ h " Exit loop by creating a breaking error 

Now that we got the top of the triangle, we need to create its body.

Àñ ñ " Argument times do: Ù " Duplicate line, the cursor comes down à<SPACE> " Append a space 

Now we got one extra line at the bottom of the buffer. This has to be replaced with -s.

Ó- " Replace every character with a - x " Delete the extra '-' 

This answer would be shorter if we could whatever we want for input 0

V, 1414 13 bytes

é\é|ÀñÙá ñVrñÒ-x 

Try it online!Try it online!

V, 18 bytes

Àñé\é|hñÀñÙá ñVr-x 

Try it online!

This answer would be shorter if we could whatever we want for input 0

V, 14 bytes

é\é|ÀñÙá ñVr-x 

Try it online!

V, 18 17 bytes

Àñé\é|hñÀñÙá ñÒ-x 

Try it online!

###Explanation

We first have a loop to check if the argument is 0. If so, the code below executes (|\ is written). Otherwise, nothing is written and the buffer is empty.

Àñ ñ " Argument times do: é\é| " Write |\ h " Exit loop by creating a breaking error 

Now that we got the top of the triangle, we need to create its body.

Àñ ñ " Argument times do: Ù " Duplicate line, the cursor comes down à<SPACE> " Append a space 

Now we got one extra line at the bottom of the buffer. This has to be replaced with -s.

Ó- " Replace every character with a - x " Delete the extra '-' 

This answer would be shorter if we could whatever we want for input 0

V, 14 13 bytes

é\é|ÀñÙá ñÒ-x 

Try it online!

Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88

V, 18 bytes

Àñé\é|hñÀñÙá ñVr-x 

Try it online!

This answer would be shorter if we could whatever we want for input 0

V, 14 bytes

é\é|ÀñÙá ñVr-x 

Try it online!