1. Rover Navigation & Drilling
rover.drill() # Drills tile in front of the rover
rover.move_down() # Moves the rover down 1 tile
rover.move_up() # Moves the rover up 1 tile
rover.move_left() # Moves the rover left 1 tile
rover.move_right() # Moves the rover right 1 tile
rover.collect() # Collects Emerald or Lithium crystals
2. Optical Radar Scanning
tile = rover.scan_down()
# Returns: 'DIRT', 'BASALT', 'MAGMA', 'LITHIUM', 'EMERALD', 'AIR'
if tile == "MAGMA":
# Divert path to prevent overheating!
rover.move_right()
3. Loops with range()
for layer in range(6):
rover.drill()
rover.move_down()
4. Cargo Lists & len()
# rover.cargo is a Python list of collected strings
print(rover.cargo) # -> ['Lithium Core', 'Emerald Geode']
total = len(rover.cargo) # -> Number of items
5. Subsystem Dictionaries
# rover.systems is a Python dictionary
rover.systems["torque"] = 90 # Overclock torque to pierce titanium armor!
rover.systems["shield"] = 100
6. Reusable Functions
def harvest_pocket():
rover.drill_right()
rover.move_right()
rover.collect()
rover.move_left()
harvest_pocket() # Runs the whole subroutine!
7. While Loops & State Checks
while rover.battery < 80:
rover.drill()
rover.move_down()
rover.collect() # Recharges at Power Cells
8. List Comprehensions
# Filter lists in a single elegant line:
emeralds = [item for item in rover.cargo if "Emerald" in item]
print("Found Emeralds:", len(emeralds))
9. Tuples & Path Coordinates
route = [("DOWN", 2), ("RIGHT", 2), ("DOWN", 1)]
for direction, steps in route:
for _ in range(steps):
rover.move_down() if direction == "DOWN" else rover.move_right()
10. Master Protocol (Combining Systems)
rover.systems["torque"] = 90 # Overclock systems
if rover.scan_down() == "MAGMA":
rover.move_right() # Radar safety detour