Comments on Stairs? Stairs! Stairs.
Parent
Stairs? Stairs! Stairs.
+1
−0
Challenge
- Make a program that takes input of an integer that's $n > 1$ and print out a staircase using a specific character for stair basing (hashes (
#
) for demonstration; you can use spaces, but not tabs or other whitespace characters), slashes (/
), and underscores (_
). - The basis of the staircase is having the hashes as to act like the stair supporters, in other words, bricks. The bottom stair starts with a slash then as we go higher, an underscore at the spot right next and above the
- Shortest program in each language wins!
Test Cases
n = 2
_/
/##
n = 3
_/
_/##
/####
n = 6
_/
_/##
_/####
_/######
_/########
/##########
+3
−0
[Python 3], 64 bytes ```pyt …
3y ago
+2
−0
Ruby, 50 bytes ->n{n.tim …
3y ago
+2
−0
[Haskell], 78 bytes …
3y ago
+1
−0
Vyxal `jṀ`, 11 bytes ``` ƛ …
3y ago
+1
−0
[JavaScript (Node.js)], 91 byt …
3y ago
+1
−0
Stax, 8 bytes Ç▐GcΦ≡◘¶ …
3y ago
+1
−0
Japt `-R`, 13 bytes Uses `= …
3y ago
Post
+1
−0
JavaScript (Node.js), 91 bytes
(n)=>[...Array(n)].map((_,i)=>console.log((' '.repeat(n-i)+'_/'+'##'.repeat(i)).slice(3)))
0 comment threads