Code for Life
Search…
Python Commands
Useful Python commands to use at the latter levels of Rapid Router
Run the following commands on the van object v, e.g. v.move_forwards()

Movement

1
v.move_forwards()
2
v.turn_left()
3
v.turn_right()
4
v.turn_around()
5
v.wait()
Copied!

Position

1
v.at_dead_end()
2
v.at_destination()
3
v.at_red_traffic_light()
4
v.at_green_traffic_light()
5
v.at_traffic_light(c)
6
# where c is 'RED' or 'GREEN'
Copied!
1
v.is_road_forward()
2
v.is_road_left()
3
v.is_road_right()
4
v.is_road(d)
5
# where d is 'FORWARD', 'LEFT', or 'RIGHT'
Copied!
Last modified 4mo ago
Export as PDF
Copy link