Feat: done except full reset, maze, dino

This commit is contained in:
2025-12-12 08:15:29 +08:00
parent fe142bae33
commit 3ae42f4e67
10 changed files with 252 additions and 76 deletions

36
mix.py
View File

@@ -1,4 +1,8 @@
import utils
import solve
def mv(tx, ty):
utils.mv(tx, ty, True)
def grow(xl, xr, yl, yr):
def init():
@@ -35,5 +39,35 @@ def grow(xl, xr, yl, yr):
utils.replant(Entities.Carrot)
return (init, run)
def grow_row(x, yl, yr):
def ret():
for y in range(yl, yr):
mv(x, y)
typ = x%2 + y%2
if typ == 0:
utils.grass()
utils.replant(Entities.Tree)
if typ == 1:
utils.soil()
utils.replant(Entities.Carrot)
if typ == 2:
utils.grass()
while True:
for y in range(yl, yr):
mv(x, y)
typ = x%2 + y%2
if typ == 1:
utils.water()
while not utils.harv():
pass
utils.replant(Entities.Carrot)
return ret
if __name__ == '__main__':
pass
set_world_size(32)
clear()
for x in range(0, 32-1):
spawn_drone(grow_row(x, 0, 32))
grow_row(32-1, 0, 32)()