modularized planting logic by splitting f2.py into main.py, pumpkins.py, and sunflowers.py; updated utilities and added .gitignore

This commit is contained in:
2026-01-10 00:19:43 -05:00
parent cb702bed32
commit db310c2a19
6 changed files with 198 additions and 122 deletions

46
main.py Normal file
View File

@@ -0,0 +1,46 @@
import utils
import pumpkins
from __builtins__ import *
def plant_carrots(width, height):
utils.plant_grid(width, height, [Entities.Carrot], 0.75, True)
def plant_grass(width, height):
utils.plant_grid(width, height, [Entities.Grass], 0.75, False)
def plant_alternating(width, height, plantWith):
utils.plant_grid(width, height, plantWith, 0.75, False)
if __name__ == "__main__":
while True:
worldSize = get_world_size()
sectionSize = worldSize // 3
utils.move_to(0, 0)
pumpkins.plant_and_verify(sectionSize, sectionSize)
utils.move_to(sectionSize+1, 0)
plant_carrots(sectionSize, sectionSize)
utils.move_to(sectionSize*2+1, 0)
plant_grass(sectionSize, sectionSize)
utils.move_to(0, sectionSize+1)
plant_alternating(sectionSize, sectionSize, [ Entities.Tree, Entities.Bush ])
utils.move_to(sectionSize+1, sectionSize+1)
pumpkins.plant_and_verify(sectionSize, sectionSize)
utils.move_to(sectionSize*2+1, sectionSize+1)
plant_carrots(sectionSize, sectionSize)
utils.move_to(0, sectionSize*2+1)
plant_alternating(sectionSize, sectionSize, [ Entities.Tree, Entities.Bush ])
utils.move_to(sectionSize+1, sectionSize*2+1)
plant_alternating(sectionSize, sectionSize, [ Entities.Tree, Entities.Bush ])
utils.move_to(sectionSize*2+1, sectionSize*2+1)
pumpkins.plant_and_verify(sectionSize, sectionSize)