This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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() |