# Reset position of drone to (0,0) def reset_position_full(): for r in range(get_pos_x()): move(West) for r in range(get_pos_y()): move(South) # Full grid N-S snake pattern for 1 plant type def full_grid(plant_choice): if plant_choice == 1: while True: reset_position_full() for hrange in range(get_world_size()): if get_pos_x() % 2 == 0: hay(North) elif get_pos_x() % 2 == 1: hay(South) elif plant_choice == 2: while True: reset_position_full() for brange in range(get_world_size()): if get_pos_x() % 2 == 0: bush(North) elif get_pos_x() % 2 == 1: bush(South) elif plant_choice == 3: while True: reset_position_full() for crange in range(get_world_size()): if get_pos_x() % 2 == 0: carrot(North) elif get_pos_x() % 2 == 1: carrot(South) # Hay 1 column def hay(hdir): for i in range(get_world_size()-1): harvest() move(hdir) harvest() move(East) # Wood 1 column def bush(wdir): for w in range(get_world_size()-1): if can_harvest(): harvest() plant(Entities.Bush) move(wdir) else: plant(Entities.Bush) move(wdir) if can_harvest(): harvest() plant(Entities.Bush) move(East) # Carrot 1 column def carrot(cdir): for c in range(get_world_size()): if num_items(Items.Carrot_Seed) <= 0: trade(Items.Carrot_Seed) if get_ground_type() != Grounds.Soil: till() plant(Entities.Carrots) if get_pos_x() % get_world_size() == get_pos_x(): if c == get_world_size() - 1: move(East) else: move(cdir) elif get_ground_type() == Grounds.Soil: if can_harvest(): harvest() plant(Entities.Carrots) if get_pos_x() % get_world_size() == get_pos_x(): if c == get_world_size() - 1: move(East) else: move(cdir) else: plant(Entities.Carrots) if get_pos_x() % get_world_size() == get_pos_x(): if c == get_world_size() - 1: move(East) else: move(cdir)