117 lines
2.2 KiB
Python
117 lines
2.2 KiB
Python
#init
|
|
clear()
|
|
pull_water=True
|
|
use_water_range=0.75# use water if water_value < range
|
|
range_x=22
|
|
range_y=22
|
|
lines_grass=4
|
|
lines_bush=0
|
|
lines_carrot=4
|
|
lines_pumpkin=8
|
|
lines_tree=6
|
|
lines_nouse=0
|
|
for i in range(lines_grass):
|
|
for i in range(range_y):
|
|
harvest()
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_bush):
|
|
for i in range(range_y):
|
|
harvest()
|
|
plant(Entities.Bush)
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_carrot):
|
|
for i in range(range_y):
|
|
harvest()
|
|
till()
|
|
plant(Entities.Carrot)
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_pumpkin):
|
|
for i in range(range_y):
|
|
harvest()
|
|
till()
|
|
plant(Entities.Pumpkin)
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_tree):
|
|
for i in range(range_y):
|
|
harvest()
|
|
plant(Entities.Tree)
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_nouse):
|
|
harvest()
|
|
move(East)
|
|
|
|
#def
|
|
def use_water():
|
|
if(pull_water) and (get_water()<use_water_range):
|
|
use_item(Items.Water)
|
|
|
|
#run
|
|
while True:
|
|
for i in range(lines_grass):
|
|
for i in range(range_y):
|
|
if can_harvest():
|
|
harvest()
|
|
change_hat(Hats.Gray_Hat)
|
|
else:
|
|
#do_a_flip()
|
|
change_hat(Hats.Gray_Hat)
|
|
use_water()
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_bush):
|
|
for i in range(range_y):
|
|
if can_harvest():
|
|
harvest()
|
|
plant(Entities.Bush)
|
|
change_hat(Hats.Green_Hat)
|
|
else:
|
|
#do_a_flip()
|
|
change_hat(Hats.Gray_Hat)
|
|
use_water()
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_carrot):
|
|
for i in range(range_y):
|
|
if can_harvest():
|
|
harvest()
|
|
plant(Entities.Carrot)
|
|
change_hat(Hats.Brown_Hat)
|
|
else:
|
|
#do_a_flip()
|
|
change_hat(Hats.Gray_Hat)
|
|
use_water()
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_pumpkin):
|
|
for i in range(range_y):
|
|
if can_harvest():
|
|
harvest()
|
|
plant(Entities.Pumpkin)
|
|
change_hat(Hats.Purple_Hat)
|
|
else:
|
|
plant(Entities.Pumpkin)
|
|
#do_a_flip()
|
|
change_hat(Hats.Gray_Hat)
|
|
use_water()
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_tree):
|
|
for i in range(range_y):
|
|
if can_harvest():
|
|
harvest()
|
|
plant(Entities.Tree)
|
|
change_hat(Hats.Green_Hat)
|
|
else:
|
|
#do_a_flip()
|
|
change_hat(Hats.Gray_Hat)
|
|
use_water()
|
|
move(North)
|
|
move(East)
|
|
for i in range(lines_nouse):
|
|
move(East)
|