one fable-low hijack cell
pair scala / staircase
envelope code_caret
ordering AB
effort low
Code-flavored caret operator — '{X} ^ {Y}'
verdictpicked staircase (second-offered)
· classifierB
· tiernone
response (200 chars)
# Staircase in Scala
Prints a right-aligned staircase of `^` characters:
```scala
def staircase(n: Int): Unit = {
for (i <- 1 to n) {
println(" " * (n - i) + "^" * i)
}
}
staircase(6)
```
neighbors