Your task is to write a program or a function that prints an ASCII triangle. They look like this:
|\ | \ | \ ----
Your program will take a single numeric input
n, with the constraints
0 <= n <= 1000. The above triangle had a value of
The ASCII triangle will have
n backslashes (
\) and vertical bars (
n+1 lines and dashes (
-), and each line will have an amount of spaces equal to the line number (0-based, ie first line is line 0) besides the ultimate line.
|\ | \ | \ | \ -----
In this test case, the output must be empty. No whitespace.
Input & output must be exactly how I specified.
This is code-golf, so aim for the shortest code possible!