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

17
sunflowers.py Normal file
View File

@@ -0,0 +1,17 @@
from __builtins__ import *
import utils
def place(width, height):
utils.plant_grid(width, height, [Entities.Sunflower], 0.75, True)
# Harvests all sunflowers in the specified area.
#
# The rules for sunflower harvesting is that we must harvest the flowers with the most petals first
# as doing so gives us an 8x bonus.
#
# Parameters:
# width (int): The number of columns in the grid.
# height (int): The number of rows in the grid.
# flowers (list): A list of sunflower entities to be harvested.
def harvest(width, height, flowers):