Page 2: Your First RUR-PLE Program: Basic Movements

2. Your First RUR-PLE Program: Basic Movements

The RUR-PLE robot is controlled by several basic commands. You can combine these commands to create complex actions.

2.1. Basic RUR Robot Commands

2.2. Simple Example: Moving a Beeper

The following code is an example that moves the robot, picks up a beeper, turns right, moves again, and then places the beeper.

# beeper_mover.py
# Function to turn the RUR robot right
def turn_right():
    turn_left()
    turn_left()
    turn_left()

move()        # Move forward one step
take()        # Pick up a beeper
turn_right()  # Turn right
move()        # Move forward one step
put()         # Put down a beeper

Before running this code, you should configure a world with a beeper in front of the robot using RUR-PLE's 'World Editor'. Save the world configuration and then run your code.