//エキスパートを育てる@コードを学ぼう2 let expert = Expert() func cX() { expert.moveForward() expert.moveForward() expert.collectGem() } func backToCenter() { expert.turnLeft() expert.turnLeft() expert.moveForward() expert.moveForward() expert.turnRight() } for i in 1 ... 2 { cX() backToCenter() } cX() expert.turnLockDown() backToCenter() for i in 1 ... 3 { expert.moveForward() } expert.turnRight() for i in 1 ... 3 { cX() backToCenter() }