Challenges

+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
_/
_/##
_/####
_/######
_/########
/##########

Why does this post require moderator attention?
Why should this post be closed?

You are accessing this answer with a direct link, so it's being shown above all other answers regardless of its score. You can return to the normal view.

+2
−0

# Ruby, 50 bytes

->n{n.times{puts ('  '*(n-_1)+'_/'+'##'*_1)[3..]}}

Attempt This Online!

Why does this post require moderator attention?

+3
−0

# Python 3, 64 bytes

def f(n):
for i in range(n):print(('  '*(n-i)+'_/'+'##'*i)[3:])


Try it online!

Why does this post require moderator attention?

+2
−0

(!)0.(*2)
i!n|i<n=(drop 3$(n-i)#' '++"_/"++i#'#'):(i+2)!n|0<1=[] (#)=replicate  Try it online! Why does this post require moderator attention? You might want to add some details to your flag. #### 0 comment threads +1 −0 # JavaScript (Node.js), 91 bytes (n)=>[...Array(n)].map((_,i)=>console.log((' '.repeat(n-i)+'_/'+'##'.repeat(i)).slice(3)))  Try it online! Why does this post require moderator attention? You might want to add some details to your flag. #### 1 comment thread Directly using a for loop is less expensive (1 comment) +1 −0 # Japt-R, 13 bytes Uses = in place of #. Æ"_/"+Xç¥ÃoÅù  Try it Æ"_/"+Xç¥ÃoÅù :Implicit input of integer U Æ :Map each X in the range [0,U) "_/" : Literal string + : Append Xç : X times repeat ¥ : "==" Ã :End map o :Modify last element Å : Slice off first character ù :Left pad each with spaces to the length of the longest :Implicit output joined with newlines Why does this post require moderator attention? You might want to add some details to your flag. #### 0 comment threads +1 −0 # VyxaljṀ, 11 bytes ƛd‛_/$꘍⁰d↳Ḣ


Try it Online!

ƛ           # Map 0...n to...
‛_/       # '_/'
$꘍ # And append... d # Double # (Implicit input)$꘍     # Spaces
d   # Double
⁰    # Initial input
Ḣ # Cut of the first character

Why does this post require moderator attention?

+1
−0

# Stax, 8 bytes

Ç▐GcΦ≡◘¶


Run and debug it

Uses spaces as the staircase fill.

Why does this post require moderator attention?