day 7 - didn't like it
This commit is contained in:
30
006/task.py
30
006/task.py
@ -10,20 +10,20 @@
|
||||
# Either the test front_is_clear() or wall_in_front(), right_is_clear() or wall_on_right(), and at_goal().
|
||||
# How to use a while loop and if/elif/else statements.
|
||||
# It might be useful to know how to use the negation of a test (not in Python).
|
||||
def turn_right():
|
||||
turn_left()
|
||||
turn_left()
|
||||
turn_left()
|
||||
# def turn_right():
|
||||
# turn_left()
|
||||
# turn_left()
|
||||
# turn_left()
|
||||
|
||||
while front_is_clear():
|
||||
move()
|
||||
turn_left()
|
||||
# while front_is_clear():
|
||||
# move()
|
||||
# turn_left()
|
||||
|
||||
while not at_goal():
|
||||
if not wall_on_right():
|
||||
turn_right()
|
||||
move()
|
||||
elif not wall_in_front():
|
||||
move()
|
||||
else:
|
||||
turn_left()
|
||||
# while not at_goal():
|
||||
# if not wall_on_right():
|
||||
# turn_right()
|
||||
# move()
|
||||
# elif not wall_in_front():
|
||||
# move()
|
||||
# else:
|
||||
# turn_left()
|
||||
Reference in New Issue
Block a user