def square() {
setPenColor(randomColor)
repeat(4) {
forward(30)
right(90)
}
}
def ladder() {
repeat(10) {
square()
forward(30) // Moves up to the next rung
}
}
clear()
setSpeed(medium)
setPenThickness(4)
repeat(10) {
ladder()
hop(-300) // Move back down to the bottom of the column
right(90) // Turn right
hop(30) // Move over to the start of the next column
left(90) // Face upward again to prepare for the next ladder
}