From 189185a97b45929561b81ed5dde2a321c537c6f2 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Tue, 23 Dec 2025 19:14:01 +0000 Subject: [PATCH] feat(*): Enable multiple drones for carrots --- carrots.py | 25 ++++++++++++++++++++++++- main.py | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/carrots.py b/carrots.py index 35d87de..8573ff5 100644 --- a/carrots.py +++ b/carrots.py @@ -18,4 +18,27 @@ def harvest_carrots(): for y in range(get_world_size()): till_and_plant() move(North) - move(East) \ No newline at end of file + move(East) + +def harvest_carrot_columns(): + columns_per_drone = get_world_size() / max_drones() + for x in range(columns_per_drone): + for y in range(get_world_size()): + till_and_plant() + move(North) + move(East) + +def spawn_drones(): + world_size = get_world_size() + + columns_per_drone = world_size / max_drones() + + i = 0 + while i < world_size: + helpers.move_to_coords(i,0) + spawn_drone(harvest_carrot_columns) + i += columns_per_drone + +def harvest_carrots_with_multiple_drones(): + spawn_drones() + harvest_carrot_columns() \ No newline at end of file diff --git a/main.py b/main.py index 39acda9..18b0b1a 100644 --- a/main.py +++ b/main.py @@ -32,7 +32,7 @@ clear() while True: run_loop(num_loops, 'hay', hay.harvest_hay_with_multiple_drones) run_loop(num_loops, 'wood', wood.harvest_wood) - run_loop(num_loops * 20, 'carrots', carrots.harvest_carrots) + run_loop(num_loops * 20, 'carrots', carrots.harvest_carrots_with_multiple_drones) run_loop(num_loops, 'pumpkins', pumpkins.harvest_pumpkins) sunflowers.initial_planting_performed = False run_loop(num_loops * 50, 'sunflowers', harvest_sunflowers_wrapper)