Comments on Tile pyramids on top of each other!
Post
Tile pyramids on top of each other!
The task
Given a positive integer as input, output tiled pyramids of this height.
How?
Let's say the inputted integer was n. From there, we output n lines of output, each having:
- A decreasing indentation of spaces starting with
n-1spaces and ending with0spaces - An increasing number of the symbol
/starting with1symbol and ending withnsymbols - An increasing number of the symbol
\starting with1symbol and ending withnsymbols
For example, with an input of 4, the output should be the following:
/\
//\\
///\\\
////\\\\
Rules
- You may output an optional newline after the required output
- Input will always be a positive integer
- This is code-golf, so lowest byte-count for each language is the winner
Test cases
Input: 1
Output:
/\
Input: 7
Output:
/\
//\\
///\\\
////\\\\
/////\\\\\
//////\\\\\\
///////\\\\\\\
Input: 11
Output:
/\
//\\
///\\\
////\\\\
/////\\\\\
//////\\\\\\
///////\\\\\\\
////////\\\\\\\\
/////////\\\\\\\\\
//////////\\\\\\\\\\
///////////\\\\\\\\\\\
[V (vim)], 11 bytes ÀñY …
5y ago
AppleScript, 264 bytes Sue …
6y ago
Vyxal `C`, 6 bytes ``` ƛ\/ …
5y ago
[Ruby], 43 bytes -> …
5y ago
Japt `-R`, 12 bytes õÈ" …
6y ago
C (compliant), 106 bytes …
5y ago
[Python 2], 57 bytes …
6y ago
Canvas, 9 7 bytes H/×║∔} …
6y ago
[JavaScript (Node.js)], 57 56 …
6y ago

1 comment thread