Chore: checkpoint

This commit is contained in:
2025-11-10 03:07:40 +08:00
commit f13ce0450b
14 changed files with 2014 additions and 0 deletions

38
pumpkin.py Normal file
View File

@@ -0,0 +1,38 @@
import utils
def grow(xl, yl, n):
def init():
for x in range(xl, xl+n):
l, r, d = yl, yl+n, 1
if x%2 == 1:
l, r, d = yl+n-1, yl-1, -1
for y in range(l, r, d):
utils.mv(x, y)
utils.soil()
def run():
check = list()
for x in range(xl, xl+n):
l, r, d = yl, yl+n, 1
if x%2 == 1:
l, r, d = yl+n-1, yl-1, -1
for y in range(l, r, d):
utils.mv(x, y)
utils.water()
utils.replant(Entities.Pumpkin)
check.append((x, y))
while len(check):
nxt = list()
for x, y in check:
utils.mv(x, y)
if not can_harvest():
nxt.append((x, y))
if get_entity_type() == Entities.Dead_Pumpkin:
plant(Entities.Pumpkin)
check = nxt
utils.mv(xl, yl)
utils.harv()
return (init, run)