the_farmer_was_replaced/Pumpkins.py

25 lines
464 B
Python
Raw Permalink Normal View History

2024-09-13 14:16:12 +02:00
def pumpkin():
# init field
field = field_plant_grid(get_world_size(), 0)
init_plant(get_world_size(), Entities.Pumpkin)
while sum_from_dict(field) < get_world_size()*get_world_size():
for cell in field:
goto(cell)
if get_entity_type() == Entities.Pumpkin:
field[cell] = 1
for cell in field:
if field[cell] == 0:
goto(cell)
better_plant(Entities.Pumpkin)
harvest()
while num_items(Items.Pumpkin) < 100000:
pumpkin()