-
Notifications
You must be signed in to change notification settings - Fork 0
/
terminal_ui.py
55 lines (53 loc) · 2.35 KB
/
terminal_ui.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
50
51
52
53
54
55
from solver_utils.functions import *
from solver_utils.data import *
from change_wd import change_wd
change_wd()
print(" _____________________________")
print(" ______ /_____________________________/")
print(" | _ \ _ _ _")
print(" | |_| | _ _ | | __ _ | | _ /_/ ______")
print(" | __/ | | | | | |/ \ | | | | / / / __ \ ")
print(" | |\ \ | | | | | /| | | | | |/ / | / |_|")
print(" | | \ \_ | |__| | | |_/ | | | | \ \ \ ")
print(" |_| \__| \_____ / \_____/ |_| |_| \_\ \ \ ")
print(" \ \ ")
print(" ________________________________________ _ \ \ ")
print(" /_______________________________________/ / / \ \ ")
print(" | |_ / | ")
print(" Welcome to the rubik solver! \______/ ")
print("")
print("------------------------------------------------------------------------")
print(" Order of faces:")
print(" _________")
print(" |__|__|__| Order of facettes in each face:")
print(" |_FACE 4_| ____________")
print("_________|__|__|__|_________________ |_0_|_1_|_2_|")
print("|__|__|__|__|__|__|__|__|__|__|__|__| |_3_|_4_|_5_|")
print("|_FACE 0_|_FACE 1_|_FACE 2_|_FACE 3_| |_6_|_7_|_8_|")
print("|__|__|__|__|__|__|__|__|__|__|__|__|")
print(" |__|__|__| ")
print(" |_FACE 5_|")
print(" |__|__|__|")
print("")
print("-----------------------------------------------------------------------")
print("Enter the colors of each face.")
print("white: w, yellow: y, green: g, blue: b, orange: o, red: r")
cube_map = input_map()
try:
print("")
moves = []
moves, cube_map = solve_first_cross(cube_map, moves, centers_map, edges_map)
moves, cube_map = solve_f2l(cube_map, moves, centers_map, edges_map, corners_map)
moves, cube_map = solve_last_cross(cube_map, moves, 4, 1, "y")
moves, cube_map = solve_oll(1, centers_map, cube_map, moves)
moves, cube_map = solve_pll(cube_map, moves, "y", plls)
moves = simplify(moves)
print("")
print("moves:", end = " ")
for i in moves:
print(i, end=" ")
print("")
except:
print("")
print("ERROR: WRONG INPUT: the cube is not solvable")
print("")