See Reeborg's home for a brief description.

Try the following demos (you can edit them). Click on start to tell Reeborg to load your program (and/or restart at the beginning). Then, click on start to run the program automatically or start to run it one instruction at a time. If you click on start, the execution will pause.

Note: World 1 [below] does not recognize turn_right() as a valid command.

Reeborg's World

Single instructions

move() turn_left() turn_right() enter_home() go_outside()
build_wall_on_left() put_beeper() pick_beeper() make_beeper()

Demos

Choose world 1 or Choose world 2
World 1
new World({
  'nb_ave': 8,
  'nb_st': 8
  });
World 2
new World({
  'nb_ave': 10,
  'nb_st': 8,
  '_turn_right': true
  });

While Loop (and going in and out)

set_delay(20)
for i in range(4):
    while front_is_clear():
        move()
    turn_left()

turn_left()
turn_left()
pause()
enter_home()
go_outside()

Beepers

def make_and_put_beeper():
  make_beeper()
  put_beeper()

make_and_put_beeper()
move()
make_and_put_beeper()
make_and_put_beeper()
turn_left()
move()

set_delay(10) # speed things up
for i in range(9):
    make_and_put_beeper()
turn_left()
move()
# should be a different image
for i in range(10):
    make_and_put_beeper()

set_delay(200) # back to default speed
turn_left()

# go back to origin; robot should appear (no beepers)
# and image of house should indicate we can go in.
move()
turn_left()
pick_beeper()
move()

Build a Square - and demonstrates uses of set_delay()

# This builds a 5 x 5 square.
# Try editing it to make a smaller
# square!
def build_square():
  set_delay(10)
  for i in range(4):
    for i in range(5):
      move()
      build_wall_on_left()
    move()
    turn_left()
  turn_left()
  set_delay(200)
  for i in range(4):
    for i in range(5):
      move()
    move()
    turn_right()
build_square()

If statement

if front_is_clear():
    move()
    move()
if front_is_blocked():
    # won't try to do this
    put_beeper()
if front_is_blocked():
    # won't do this
    turn_left()
else:
    # will do this instead
    move()
    turn_left()