Created
November 1, 2025 18:38
-
-
Save tarmo888/0c5ee0cf250cc1bad4301aa80bc523b5 to your computer and use it in GitHub Desktop.
drone spawning template for The Farmer Was Replaced
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 do_work(y): | |
| # example task | |
| till() | |
| def drone_template(y): | |
| def worker_task(): | |
| # introduce yourself | |
| print("ready", y) | |
| # do stuff and move right forever | |
| while True: | |
| do_work(y) | |
| move(East) | |
| # return task | |
| return worker_task | |
| clear() | |
| for i in range(max_drones()): | |
| # get drone task and spawn drone with the task | |
| drone_task = drone_template(i) | |
| if not spawn_drone(drone_task): | |
| # when no more drones, apply task on yourself | |
| drone_task() | |
| # move to upper row | |
| move(North) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment