U E D R , A S I H C RSS

코드레이스/2007/RUR_PLE

1.

  • : 2
  • 10
  • 20
  • 15(6)
  • 힌트,

2. RUR-PLE ?

  • . . .
  • Python .
  • Python , . . . -_-
  • -_-; 화 . , .(하 ..) .

3.1. 1

  • . .

3.2. 2

  • .

3.3. 3

  • .

4.

4.1. ?

  • Robot: Code and Learn 탭 택한.
  • .

~cpp 
move()
turn_off()
  • Mp3 Play .
  • test .
  • play .

4.1.1.

  • .
  • 향 키 .
  • 향 키 .

4.2. ?

  • .

~cpp 
move()
turn_left()
move()
turn_off()
  • .

4.3. (beeper)

  • beeper .
  • beeper : pick_beeper()
  • beeper : put_beeper()
  • beepers1.wld 파 .
  • .



4.4. ?

  • RUR-PLE .
  • Play Play step into . . highlighting .
  • Play step into (play ) .
  • step into

4.5. ~!

  • . . ! 클~! 해 .

4.6.

  • def .

  • repeat 행해( 포함) .

~cpp 
def turn_right():
    repeat(turn_left, 3)
  • 화 해 .

4.7. if

  • next_to_a_beeper() : beeper true, false 환한.

~cpp 
if next_to_a_beeper():
    pick_beeper()
  • if , repeat .



4.7.1. else

  • front_is_clear() : true, false
  • left_is_clear() :
  • right_is_clear() :
  • else .

~cpp 
def move_or_turn():
    if front_is_clear():
        move()
    else:
        turn_left()
  • . . 크 5 5*4=20 ..


4.8. not

  • not .

~cpp 
if not next_to_beeper():
    move()
else:
    turn_off()	

4.8.1.

  • .


  • . . ..

~cpp 
# introducing vocabulary related to the problem
next_to_a_carrot = next_to_a_beeper
plant_carrot = put_beeper
pick_carrot = pick_beeper

def one_carrot_only():
    if not next_to_a_carrot():
        plant_carrot()      # replace missing seed
    else:
        pick_carrot()
        if not next_to_a_carrot(): # oops!
            plant_carrot()  # we had removed the only one

4.9. while

  • .

~cpp 
next_to_a_carrot = next_to_a_beeper
plant_carrot = put_beeper
pick_carrot = pick_beeper

def one_carrot_only():
    while next_to_a_carrot():
        pick_carrot()      # pick them all!
				
    plant_carrot()         # replant only one
  • harvest3.wld 파 .
  • while 2 .


4.10. Amazing Part

4.11. Sorting

  • sort0_1.wld 파 .
  • .
  • 2 column .


  • sort0_2.wld 파 .
  • 트 해.


  • sort1 파 .
  • column .


  • sort2

5.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:19
Processing time 0.0623 sec