Last active
October 22, 2025 17:51
-
-
Save 1337dondongo/6cb2506bb1847d1b4490260673aa49c4 to your computer and use it in GitHub Desktop.
The Farmer Was Replaced Maze with Drone and Upgraded Maze
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
| def create_maze(): | |
| plant(Entities.Bush) | |
| while get_entity_type()==Entities.Bush: | |
| if num_items(Items.Weird_Substance) > get_world_size(): | |
| use_item(Items.Weird_Substance, get_world_size()*2) | |
| return 1 | |
| if can_harvest(): | |
| harvest() | |
| plant(Entities.Bush) | |
| if num_items(Items.Fertilizer)==0: | |
| # I do not have trade unlocked | |
| #trade(Items.Fertilizer) | |
| return 0 | |
| use_item(Items.Fertilizer) | |
| return 1 | |
| def treasure_hunt(): | |
| dir = West | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| while True: | |
| move(dir) | |
| x2 = get_pos_x() | |
| y2 = get_pos_y() | |
| if x==x2 and y==y2: | |
| if dir==West: | |
| dir = North | |
| elif dir==North: | |
| dir = East | |
| elif dir==East: | |
| dir = South | |
| elif dir==South: | |
| dir = West | |
| else: | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| if dir==West: | |
| dir = South | |
| elif dir==North: | |
| dir = West | |
| elif dir==East: | |
| dir = North | |
| elif dir==South: | |
| dir = East | |
| if get_entity_type()==Entities.Treasure: | |
| harvest() | |
| return 1 | |
| if get_entity_type()==Entities.Grass: | |
| harvest() | |
| return 1 | |
| def drone_hunt(): | |
| dir = East | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| while True: | |
| move(dir) | |
| x2 = get_pos_x() | |
| y2 = get_pos_y() | |
| if x==x2 and y==y2: | |
| if dir==West: | |
| dir = South | |
| elif dir==North: | |
| dir = West | |
| elif dir==East: | |
| dir = North | |
| elif dir==South: | |
| dir = East | |
| else: | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| if dir==West: | |
| dir = North | |
| elif dir==North: | |
| dir = East | |
| elif dir==East: | |
| dir = South | |
| elif dir==South: | |
| dir = West | |
| if get_entity_type()==Entities.Treasure: | |
| harvest() | |
| return 1 | |
| while True: | |
| for i in range(8): | |
| spawn_drone(drone_hunt) | |
| move (North) | |
| if create_maze(): | |
| if treasure_hunt(): | |
| continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment