//2つのエキスパート@コードを学ぼう2 let a = Expert() let b = Expert() world.place(a, atColumn: 3, row: 0) world.place(b, atColumn: 0, row: 4) func turnA() { a.turnLeft() a.turnLeft() } func turnB() { b.turnLeft() b.turnLeft() } turnA() a.turnLock(up: true, numberOfTimes: 2) a.turnLeft() a.move(distance: 3) a.collectGem() turnA() a.move(distance: 4) turnB() b.turnLockDown() a.move(distance: 2) a.turnLock(up: false, numberOfTimes: 2) b.turnRight() for i in 1 ... 7 { if b.isOnGem { b.collectGem() } b.moveForward() }