clear()
def move_to_xy(target_x, target_y):
while get_pos_x() < target_x:
move(East)
while get_pos_x() > target_x:
move(West)
while get_pos_y() < target_y:
move(North)
while get_pos_y() > target_y:
move(South)
while True:
for y in range(6):
if y % 2 == 0:
# 偶数行从左到右
x_range = range(6)
else:
# 奇数行从右到左
x_range = range(5, -1, -1)
for x in x_range:
move_to_xy(x, y)
if y >= 3:
# 上灌木
if get_ground_type() != Grounds.Soil:
till()
plant(Entities.Bush)
if can_harvest():
harvest()
plant(Entities.Bush)
else:
# 下萝卜
if get_ground_type() != Grounds.Soil:
till()
plant(Entities.Carrot)
if can_harvest():
harvest()
plant(Entities.Carrot)
