Feat: done except full reset, maze, dino
This commit is contained in:
36
mix.py
36
mix.py
@@ -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)()
|
||||
|
||||
Reference in New Issue
Block a user