U E D R , A S I H C RSS

데블스캠프2011/셋째날/RUR-PLE/송지원

Difference between r1.2 and the current

@@ -53,4 +53,19 @@
turn_off()
}}}

=== 미로 찾기 ===
== 미로 찾기 == 
{{{
def turn_right():
repeat(turn_left, 3)
 
while not on_beeper() :
if right_is_clear():
turn_right()
move()
elif front_is_clear():
move()
else:
turn_left()
 
turn_off()
}}}



춤추기

def dance() :
    repeat(turn_left,4)
for number of range (4) :
    while(front_is_clear) :
	move()
	dance()

추수하기

def turn_right() :
    repeat(turn_left,3)

while front_is_clear():
    while(front_is_clear()) : 
        move()
        if(on_beeper()) : pick_beeper()
    turn_left()
    if(front_is_clear()) : move()
    else : turn_off()
    if(on_beeper()) : pick_beeper()
    turn_left()
    while(front_is_clear()) : 
        move()
        if(on_beeper()) : pick_beeper()
    turn_right()
    if(front_is_clear()) : move()
    else : turn_off()
    if(on_beeper()) : pick_beeper()
    turn_right()

쓰레기 줏어서 버리기

while front_is_clear() :
    move()
    while on_beeper() :
        pick_beeper()
turn_left()
turn_left()

while front_is_clear() :
    move()

turn_left()
turn_left()
turn_left()
move()
while carries_beepers() :
 put_beeper()
turn_off()

미로 찾기

def turn_right(): 
    repeat(turn_left, 3) 

while not on_beeper() :
    if right_is_clear():  
        turn_right() 
        move() 
    elif front_is_clear():  
        move() 
    else:  
        turn_left() 

turn_off() 
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:14
Processing time 0.0349 sec