-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
49 lines (33 loc) · 1.2 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import random
import setup
from movement import *
setup.init()
def main():
manual = (input("Would you like to control the mice manual? (y/N): ") == 'y')
if manual:
print("MANUAL MODE: type 'stop' to stop\n")
while True:
direction = input("Choose a direction (right, left, up, down): ")
while direction not in ['right', 'left', 'up', 'down']:
if direction == 'stop':
reset_pos(start)
print("POSITION RESET")
main()
print("FAILURE: invalid input\n")
direction = input("Choose a direction (right, left, up, down): ")
move(direction)
print_maze(mouse, finish)
elif not manual:
print("SEMI AUTO MODE: type 'stop' to stop\n")
stop = ''
while stop != 'stop':
directions = ['right', 'left', 'up', 'down']
random_direction = random.choice(directions)
move(random_direction)
print_maze(mouse, finish)
stop = input("Press ENTER to continue...\n")
reset_pos(start)
print("POSITION RESET")
main()
if __name__ == '__main__':
main()