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

40
maze.py
View File

@@ -1,5 +1,5 @@
import solve, utils
import sunflower
import pumpkin
d = [North, West, South, East]
def grow(xl, yl, n, repeat=1):
@@ -45,10 +45,36 @@ def grow(xl, yl, n, repeat=1):
return (init, run)
def grow_full(x, y, replant=False):
substance = 4 * 2**(num_unlocked(Unlocks.Mazes) - 1)
def ret():
utils.mv(x, y)
do_a_flip()
while True:
if get_entity_type() == Entities.Treasure:
harvest()
if replant and get_entity_type() != Entities.Hedge:
plant(Entities.Bush)
use_item(Items.Weird_Substance, substance)
return ret
if __name__ == '__main__':
set_world_size(32)
utils.spawn(solve.run([
sunflower.growbase(0, 2, 0, 8),
sunflower.grow(2, 8, 0, 8),
]))
solve.run([grow(0, 0, 32)])()
set_world_size(8)
clear()
jobs = list()
for d in range(2):
for x in range(4):
for y in range(4):
if x == 2 and y == 2:
jobs.append(grow_full(d*4+x, y, True))
else:
jobs.append(grow_full(d*4+x, y))
for job in jobs[:-1]:
spawn_drone(job)
jobs[-1]()