Init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from library import turn_right
|
||||
|
||||
while wall_on_right():
|
||||
move()
|
||||
turn_left()
|
||||
turn_left()
|
||||
move()
|
||||
################################################################
|
||||
# WARNING: Do not change this comment.
|
||||
# Library Code is below.
|
||||
################################################################
|
||||
def turn_right():
|
||||
for _ in range(3):
|
||||
turn_left()
|
||||
@@ -0,0 +1,26 @@
|
||||
def repair_stone():
|
||||
if object_here():
|
||||
pass
|
||||
else:
|
||||
put()
|
||||
|
||||
def repair_pillar():
|
||||
turn_left()
|
||||
while front_is_clear():
|
||||
repair_stone()
|
||||
move()
|
||||
repair_stone()
|
||||
turn_left()
|
||||
turn_left()
|
||||
while front_is_clear():
|
||||
move()
|
||||
turn_left()
|
||||
move()
|
||||
|
||||
think(0)
|
||||
for _ in range(3):
|
||||
move()
|
||||
move()
|
||||
repair_pillar()
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
def turn_around():
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def turn_right():
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def collect_star():
|
||||
if object_here():
|
||||
take()
|
||||
|
||||
def collect_all_in_row():
|
||||
while front_is_clear():
|
||||
collect_star()
|
||||
move()
|
||||
collect_star()
|
||||
|
||||
def move_up():
|
||||
turn_around()
|
||||
while wall_on_right():
|
||||
move()
|
||||
turn_right()
|
||||
move()
|
||||
turn_left()
|
||||
while front_is_clear():
|
||||
move()
|
||||
turn_around()
|
||||
|
||||
|
||||
think(3)
|
||||
for _ in range(8):
|
||||
collect_all_in_row()
|
||||
move_up()
|
||||
collect_all_in_row()
|
||||
@@ -0,0 +1,42 @@
|
||||
def turn_around():
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def turn_right():
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def double_star():
|
||||
take()
|
||||
move()
|
||||
put()
|
||||
put()
|
||||
turn_around()
|
||||
move()
|
||||
turn_around()
|
||||
|
||||
def double_all_stars():
|
||||
while object_here():
|
||||
double_star()
|
||||
|
||||
def move_star():
|
||||
take()
|
||||
move()
|
||||
put()
|
||||
turn_around()
|
||||
move()
|
||||
turn_around()
|
||||
|
||||
def move_all_stars():
|
||||
while object_here():
|
||||
move_star()
|
||||
|
||||
|
||||
move()
|
||||
double_all_stars()
|
||||
move()
|
||||
turn_around()
|
||||
move_all_stars()
|
||||
move()
|
||||
move()
|
||||
@@ -0,0 +1,53 @@
|
||||
def turn_around():
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def turn_right():
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def set_stars():
|
||||
move()
|
||||
while wall_on_right():
|
||||
put()
|
||||
move()
|
||||
|
||||
def move_to_start():
|
||||
turn_right()
|
||||
move()
|
||||
turn_right()
|
||||
while right_is_clear():
|
||||
move()
|
||||
while wall_on_right():
|
||||
move()
|
||||
turn_right()
|
||||
move()
|
||||
turn_right()
|
||||
move()
|
||||
|
||||
def move_to_last_star():
|
||||
while object_here():
|
||||
move()
|
||||
turn_around()
|
||||
move()
|
||||
turn_around()
|
||||
|
||||
def move_to_end():
|
||||
while front_is_clear():
|
||||
move()
|
||||
|
||||
def count_stars():
|
||||
move_to_start()
|
||||
while object_here():
|
||||
move_to_last_star()
|
||||
if object_here():
|
||||
take()
|
||||
move_to_end()
|
||||
put()
|
||||
move_to_start()
|
||||
|
||||
|
||||
set_stars()
|
||||
count_stars()
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
from library import turn_around, turn_right, move_to_wall
|
||||
|
||||
|
||||
def clean_room():
|
||||
turn_left()
|
||||
while front_is_clear():
|
||||
turn_right()
|
||||
clean_row()
|
||||
move_to_next_row()
|
||||
turn_right()
|
||||
clean_row()
|
||||
|
||||
|
||||
def clean_row():
|
||||
while front_is_clear():
|
||||
clean_cell()
|
||||
move()
|
||||
clean_cell()
|
||||
turn_around()
|
||||
move_to_wall()
|
||||
turn_around()
|
||||
|
||||
|
||||
def clean_cell():
|
||||
if object_here():
|
||||
take()
|
||||
|
||||
|
||||
def move_to_next_row():
|
||||
turn_left()
|
||||
move()
|
||||
|
||||
think(30)
|
||||
clean_room()
|
||||
|
||||
|
||||
################################################################
|
||||
# WARNING: Do not change this comment.
|
||||
# Library Code is below.
|
||||
################################################################
|
||||
def turn_right():
|
||||
for _ in range(3):
|
||||
turn_left()
|
||||
|
||||
def turn_around():
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
def move_to_wall():
|
||||
while front_is_clear():
|
||||
move()
|
||||
@@ -0,0 +1,70 @@
|
||||
def turn_right():
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
|
||||
def turn_around():
|
||||
turn_left()
|
||||
turn_left()
|
||||
|
||||
|
||||
def set_stone_above():
|
||||
turn_left()
|
||||
move()
|
||||
put()
|
||||
turn_right()
|
||||
move()
|
||||
turn_right()
|
||||
move()
|
||||
turn_left()
|
||||
|
||||
|
||||
def build_first_row():
|
||||
while front_is_clear():
|
||||
put()
|
||||
move()
|
||||
put()
|
||||
turn_around()
|
||||
while front_is_clear():
|
||||
move()
|
||||
turn_around()
|
||||
|
||||
|
||||
def build_second_row():
|
||||
move()
|
||||
while front_is_clear():
|
||||
set_stone_above()
|
||||
turn_left()
|
||||
move()
|
||||
turn_left()
|
||||
move()
|
||||
while object_here():
|
||||
move()
|
||||
turn_around()
|
||||
move()
|
||||
|
||||
|
||||
def build_next_row():
|
||||
move()
|
||||
while object_here():
|
||||
set_stone_above()
|
||||
turn_left()
|
||||
move()
|
||||
turn_left()
|
||||
move()
|
||||
if object_here():
|
||||
take()
|
||||
move()
|
||||
while object_here():
|
||||
move()
|
||||
turn_around()
|
||||
move()
|
||||
|
||||
|
||||
think(3)
|
||||
set_trace_style("invisible")
|
||||
build_first_row()
|
||||
build_second_row()
|
||||
while object_here():
|
||||
build_next_row()
|
||||
@@ -0,0 +1,19 @@
|
||||
def plant_a_tulip():
|
||||
move()
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
move()
|
||||
put()
|
||||
turn_left()
|
||||
turn_left()
|
||||
move()
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
move()
|
||||
|
||||
while front_is_clear():
|
||||
plant_a_tulip()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user