No older revisions available
No older revisions available
1. RUR-PLE/Newspaper(함수화 전) ¶
~cpp
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
put_beeper()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
turn_off()
2. RUR-PLE/Newspaper(함수화 후) ¶
~cpp
def climbUpOneStair():
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
def climbDownOneStair():
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
def turnBack():
turn_left()
turn_left()
move()
climbUpOneStair()
climbUpOneStair()
climbUpOneStair()
climbUpOneStair()
put_beeper()
turnBack()
move()
climbDownOneStair()
climbDownOneStair()
climbDownOneStair()
climbDownOneStair()
turn_off()
3. RUR-PLE/Newspaper(함수화 후, 함수 반복제거) ¶
~cpp
def climbUpOneStair():
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
move()
def climbDownOneStair():
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
def turnBack():
turn_left()
turn_left()
move()
repeat(climbUpOneStair,4)
put_beeper()
turnBack()
move()
repeat(climbDownOneStair,4)
turn_off()