-
Notifications
You must be signed in to change notification settings - Fork 0
/
diagonal_menu_page.py
68 lines (51 loc) · 1.96 KB
/
diagonal_menu_page.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
56
57
58
59
60
61
62
63
64
65
66
67
68
import frontend
from blessed import Terminal
from colors import Color
import backend
cat = '''
|\ _,,,---,,_
ZZZzz /,`.-'`' -. ;-;;,_
|,4- ) )-,_. ,\ ( `'-'
'---''(_/--' `-'\_)
'''
def get_diagonal_menu_input():
term = Terminal()
# then centralizes input by adding half the length of terminal using blank spaces
term_width = term.width
blank = ""
for _ in range(int(term_width/2) - 5):
blank = blank + " "
puzzles_list = backend.get_folder_file_list("diagonal_puzzles")
input_choice = ""
input_condition = False
while not input_condition:
print()
print(term.center(" What do you want to play? "))
print(blank, end="")
input_choice = input().strip()
if input_choice in puzzles_list:
input_condition = True
else:
print(term.center(Color.RED + " Error. Input Valid Choice. " + Color.END))
return input_choice
def show_diagonal_menu():
term = Terminal()
print()
print()
frontend.center_multiline_string(cat)
print()
print()
print(term.center(" Diagonal Mode \n"))
print()
print(term.center(" diagonal01.sud "))
print(term.center(" diagonal02.sud "))
print(term.center(" diagonal03.sud "))
print(term.center(" diagonal04.sud "))
print(term.center(" diagonal05.sud \n"))
def open_diagonal_page():
frontend.show_title("Sudoku")
frontend.show_divider_line()
show_diagonal_menu()
frontend.show_divider_line()
user_input = get_diagonal_menu_input()
return user_input