U E D R , A S I H C RSS

RUR-PLE/Newspaper


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() 
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:27:49
Processing time 0.0206 sec