U E D R , A S I H C RSS

데블스캠프2005/RUR-PLE

1. 데블2005/RUR-PLE

  • : 01 남
  • : 데블

3.

  • : 4 5
  • 명 5
  • 로봇 법 5
  • 로 돌기 5 + 5
  • 기기 명 + 5
  • 깅 방법 5
  • 벽 만들기 5 + 20(문배달, )
  • 기 5 + (10)
  • if문 + 5
  • not + (2) 40
  • while + (3) 10
  • sorting 문 120

4. RUR-PLE 란 ?

  • 로그래밍 를 배는것 다는 만들 다. 보면 밌다. 된다.
  • Python 로그래밍 를 배 다.
  • Python 문법 기반만, 몰라 다. 나가기 때문다. 변 다. -_-
  • 로 로봇 로그래밍 그 로봇 로그래밍 는데로 는것 보면 되는 만 -_-; 로나 그 로봇 는 것 보면 로그래밍 다. 드들 모가 만, 로봇 로그래밍 는다면 는 방다.(로 복 명령 그 명령 게 복 로봇 게 만드는 로..) 말그대로 로봇 로그래밍 로나 다.

5.

5.1. 1

  • 로그래밍 는 것 기를 는 것과 다. 당 그것 기 말고 다.

5.2. 2

  • 람들 로그램 다.

5.3. 3

  • 로그램 때는 반복 라.

6.

6.1. 로봇 볼까?

  • Robot: Code and Learn 다.
  • 드를 본다.

~cpp 
move()
turn_off()
  • Mp3 Play 다.
  • 라는 면 test 라고 다.
  • 그리고 다 play 른다.

6.1.1. 보드로 로봇

  • 로봇 다.
  • 보드를 르면 방 바뀐다.
  • 보드를 르면 다.

6.2. 볼까?

  • 드를 본다.

~cpp 
move()
turn_left()
move()
turn_off()
  • 로 돌고나 로 가고 나 는것 다.

6.2.1.

  • 로봇 2 그리면는것 만들.

  • 로봇 래 그림과 같 본다.


6.3. (beeper) 기기

  • beeper를 겨 보.
  • beeper를 드는 명령 : pick_beeper()
  • beeper를 내려 놓는 명령 : put_beeper()
  • beepers1.wld 다.
  • 래 그림과 같 드를 본다.



6.4. 깅 방법?

  • RUR-PLE 다.
  • Play Play 모대기 는것 step into 다. 명령 된다. 되고 는 명령드 부 로 highlighting 된다.
  • Play 고 나 로봇 step into (play 는) 면 그 명령 된다.
  • step into
  • 는 빨

6.5. 벽 만들~!

  • 다. 그럼 래 그림과 같 다. 릭! 릭~! 벽들 만들 다.

6.5.1.

  • 래 그림과 같 로봇 문배달 드를


  • 1 모두를 드를 .


6.6.

  • def 를 다.

  • repeat 명령 (명령 ) 방복 다.

~cpp 
def turn_right():
    repeat(turn_left, 3)
  • 벽 만들기 드들 다.

6.7. if 문

  • next_to_a_beeper() : beeper가 로봇 면 true, 면 false를 반다.

~cpp 
if next_to_a_beeper():
    pick_beeper()
  • if문과 , repeat를 면과 같 다.



6.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 로..


6.8. not

  • not 다.

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

6.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

6.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 리 가능 다.


6.10. Amazing Part

  • 다. 몇가 면 놀라 기능 되는것 다.
  • sorting 문고나 길. Amazing

6.11. Sorting

  • sort0_1.wld 다.
  • 그림로 로봇 게 만들면 된다.
  • 래는 게 2개 column 다.


  • sort0_2.wld 다.
  • 래 그림과 같 렬되 는 경 대로 동되는 본다.


  • sort1 다.
  • 래 그림과 같 더 복 러개 column 다.


  • sort2 는 공개

7.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:58
Processing time 0.0345 sec