Skip to content

Instantly share code, notes, and snippets.

@tarmo888
Created November 1, 2025 18:38
Show Gist options
  • Select an option

  • Save tarmo888/0c5ee0cf250cc1bad4301aa80bc523b5 to your computer and use it in GitHub Desktop.

Select an option

Save tarmo888/0c5ee0cf250cc1bad4301aa80bc523b5 to your computer and use it in GitHub Desktop.
drone spawning template for The Farmer Was Replaced
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