Skip to content

Instantly share code, notes, and snippets.

# Solve an acyclic maze by hugging the wall.
# You will need some Fertilizer to start.
def do_right_hand_maze():
harvest()
plant(Entities.Bush)
while get_entity_type() == Entities.Bush:
use_item(Items.Fertilizer)
heading = North
while get_entity_type() != Entities.Treasure:
@zapakh
zapakh / do_maze.py
Created May 22, 2024 06:01
In-situ DFS maze solver for The Farmer Was Replaced
# Make sure you have enough Fertilizer before starting.
def do_maze(iterations=1):
# Define some geometry help for later
opp = {North: South, East: West,
South: North, West: East}
dx = {North: 0, East: 1, South: 0, West: -1}
dy = {North: 1, East: 0, South: -1, West: 0}
# Start a Maze.
harvest()