Karel Language Reference
Primitives
- void step() - Move Karel one intersection forward.
- void turn_left() - Pivots Karel 90 degrees left.
- void pick_beeper() - Take a beeper from the current intersection and put it in the beeper bag.
- void put_beeper() - Take a beeper from the beeper bag and put it at the current intersection.
- void turn_on(char* path) - Turn Karel on.
- void turn_off() - Turn Karel off.
Sensors
- bool front_is_clear() - true if there is no wall directly in front of Karel, false if there is.
- bool beepers_present() - true if Karel is standing at an intersection that has a beeper, false otherwise.
- bool facing_north() - true if Karel is facing north, false otherwise.
- bool beepers_in_bag() - true if there is at least one beeper in Karel's beeper bag, false if the beeper bag is empty.
Misc
- void set_step_delay(int) - Sets delay of one Karel's step in miliseconds.
Super Karel Language Reference
Super Karel is an extension to the basic Karel the Robot library. Super Karel is "equipped" with additional sensors.
Sensors
- bool front_is_blocked() - true if there is a wall directly in front of Karel, false otherwise.
- bool left_is_clear() - true if there is no wall immediately to Karel's left, false if there is.
- bool left_is_blocked() - true if there is a wall immediately to Karel's left, false otherwise.
- bool right_is_clear() - true if there is no wall immediately to Karel's right, false if there is.
- bool right_is_blocked() - true if there is a wall immediately to Karel's right, false otherwise.
- bool no_beepers_present() - true if there is not beeper at the current intersection, false if there is a beeper at the current intersection.
- bool not_facing_north() - true if Karel is not facing north, false if he is facing north.
- bool facing_south() - true if Karel is facing south, false otherwise.
- bool not_facing_south() - true if Karel is not facing south, false if he is facing south.
- bool facing_east() - true if Karel is facing east, false otherwise.
- bool not_facing_east() - true if Karel is not facing east, false if he is facing east.
- bool facing_west() - true if Karel is facing west, false otherwise.
- bool not_facing_west() - true if Karel is not facing west, false if he is facing west.
- bool no_beepers_in_bag() - true if Karel's beeper bag is empty, false if there is at least one beeper in the beeper bag.