본문 바로가기

Playgrounds'플레이그라운드'

Playgrounds '플레이그라운드' 15.

'코드'

반복 패턴의 함수를 정의해 보세요.

func [반복 사용 가능한 명칭을 입력해주세요] () {

[                                         ]

}

[                                          ]

[                                          ] 

func [go]() {

turnLeft()

}

moveForward()

collectGem()

moveForward()

toggleSwitch()

moveForward()

go()

moveForward()

collectGem()

moveForward()

toggleSwitch()

moveForward()

collectGem()

moveForward()

collectGem()

go()

moveForward()

collectGem()

moveForward()

toggleSwitch()

moveForward()

go()

moveForward()

collectGem()

moveForward()

toggleSwitch()