the_farmer_was_replaced/Polyculture.py

19 lines
396 B
Python
Raw Normal View History

2024-09-13 14:16:12 +02:00
def polyculture():
field = field_plant_grid(get_world_size(), Entities.Grass)
for cell in field:
goto(cell)
if get_companion() != None:
c, x, y = get_companion()
field[(x,y)] = c
p = field[(get_pos_x(), get_pos_y())]
better_plant(p)
if can_harvest():
harvest()
init_plant(get_world_size(), Entities.Grass)
while num_items(Items.Carrot) < 30000:
polyculture()