feat(*): Add main file and builtins

This commit is contained in:
Josh Creek
2025-12-23 15:05:58 +00:00
commit 9ccebf4eae
2 changed files with 1345 additions and 0 deletions
+1307
View File
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
import hay
import wood
import carrots
import pumpkins
import sunflowers
import cacti
sunflowers_array = {} # sunflowers_array[(x, y)] = petals
cactus_array = {} # cactus_array[(x, y)] = size
num_loops = 10
def run_loop(number_of_loops, label, fn):
clear()
for i in range(number_of_loops):
# print(label, i+1)
fn()
def harvest_sunflowers_wrapper():
# this wrapper function is needed as the game doesn't support llambdas,
# which are needed as we're passing an argument into the function
sunflowers.harvest_sunflowers(sunflowers_array)
def harvest_cacti_wrapper():
# this wrapper function is needed as the game doesn't support llambdas,
# which are needed as we're passing an argument into the function
cacti.harvest_cacti(cactus_array)
clear()
while True:
run_loop(num_loops, 'hay', hay.harvest_hay)
run_loop(num_loops, 'wood', wood.harvest_wood)
run_loop(num_loops * 20, 'carrots', carrots.harvest_carrots)
run_loop(num_loops, 'pumpkins', pumpkins.harvest_pumpkins)
sunflowers.initial_planting_performed = False
run_loop(num_loops * 50, 'sunflowers', harvest_sunflowers_wrapper)
run_loop(1, 'cacti', harvest_cacti_wrapper)