.코드.

let expert = Expert()
expert.moveForward()
expert.turnLockUp()
expert.turnLeft()
expert.turnRight()
Expert 유형의 인스턴스를 초기화하고 turnLockUp() 메소드로 퍼즐을 풀어 보세요.

for i in 1 ... 3 {
expert.moveForward()
}
expert.turnLockUp()
expert.turnLeft()
expert.turnLeft()
for i in 1 ... 3 {
expert.moveForward()
}
expert.turnLeft()
for i in 1 ... 3 {
expert.moveForward()
}
expert.collectGem()
expert.turnLeft()
expert.turnLeft()
for i in 1 ... 6 {
expert.moveForward()
}
expert.collectGem()
expert.turnLeft()
expert.turnLeft()
for i in 1 ... 3 {
expert.moveForward()
}
expert.turnRight()
for i in 1 ... 3 {
expert.moveForward()
}
expert.collectGem()
'Playgrounds'플레이그라운드'' 카테고리의 다른 글
Playgrounds '플레이그라운드' 16. (0) | 2024.05.24 |
---|---|
Playgrounds '플레이그라운드' 15. (0) | 2024.05.22 |
Playgrounds '플레이그라운드' 13. (0) | 2024.05.20 |
Playgrounds '플레이그라운드' 12. (0) | 2024.05.20 |
Playgrounds '플레이그라운드' 11. (0) | 2024.05.18 |