RUR-PLE Reference
By admin On February 24th, 2010This page is a reference for commands which are specific to RUR-PLE — that is, commands which you use in RUR-PLE, but cannot be found in the textbook we are using.
Actions
- move()
- Makes Reeborg move forward one space
- turn_left()
- Makes Reeborg turn to his left
- pick_beeper()
- Makes Reeborg pick up a beeper
(crashes if he is not standing on a beeper)
- Makes Reeborg pick up a beeper
- put_beeper()
- Makes Reeborg put down a beeper
(crashes if he is not carrying any beepers)
- Makes Reeborg put down a beeper
- turn_off()
- Makes Reeborg turn off, ending the program
True/false tests
- front_is_clear()
- true if there is no wall in front of Reeborg
- false otherwise
- left_is_clear()
- true if there is no wall on Reeborg’s left side
- false otherwise
- right_is_clear()
- true if there is no wall on Reeborg’s right side
- false otherwise
- carries_beepers()
- true if Reeborg is carrying any beepers
- false otherwise
- on_beeper()
- true if Reeborg is standing on a beeper
- false otherwise
Getting information
- get_avenue()
- Returns the number of the avenue Reeborg is on
- get_street()
- Returns the number of the street Reeborg is on
- get_position()
- Returns a list like this:
(avenue, street), where “avenue” is the number of the avenue Reeborg is on, and “street” is the number of the street Reeborg is on
- Returns a list like this:
- get_direction()
- Returns “n”, “e”, “s”, or “w” if Reeborg is facing north, east, south, or west (respectively)
Note: The commands under Getting Information are only available in this unofficial release of RUR-PLE (if you were to download the latest release from the official RUR-PLE website, you wouldn’t be able to use these commands).
