パターンをネストする@コードを学ぼう1
//パターンをネストする@コードを学ぼう1 func turnAround() { turnLeft() turnLeft() } func solveStair() { moveForward() collectGem() turnAround() moveForward() } solveStair() solveStair() turnLeft() solveStair() solveStair()
//パターンをネストする@コードを学ぼう1 func turnAround() { turnLeft() turnLeft() } func solveStair() { moveForward() collectGem() turnAround() moveForward() } solveStair() solveStair() turnLeft() solveStair() solveStair()