-
Notifications
You must be signed in to change notification settings - Fork 1
/
weeklymenus.py
150 lines (136 loc) · 5.1 KB
/
weeklymenus.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import subprocess
from week0 import noships
from week0 import swap
from week0 import matrix
from week1 import fibonacci
from week1 import infoDB
from week2 import factorial
from week2 import triangular
import submenu
def weekZero():
def get_menu_choice():
subprocess.call("clear", shell=True)
def print_menu(): # Your menu design here
print(30 * "-", "Python Menu", 30 * "-")
print("1. Swap")
print("2. Matrix")
print("3. Animation")
print("4. Megamind Animation")
print("*. Exit")
print(73 * "-")
loop = True
# int_choice = -1 //debug thing
while loop: # While loop which will keep going until loop = False
subprocess.call("clear", shell=True)
print_menu() # Displays menu
choice = input("Enter your choice [1-5]: ")
if choice == '1':
print("you chose number 1, the Swap")
age = swap.getinput()
sorted_age = swap.sort(age[0], age[1]) #prints out the variable in arrays
print(sorted_age[0], sorted_age[1])
input("press enter to go back")
# int_choice = 1 //more debug
elif choice == '2':
print("you chose Matrix")
matrix.Matrix()
input("press enter to go back")
elif choice == '3':
subprocess.call("clear", shell=True)
subprocess.call("python ship.py", shell=True)
# int_choice = 3
elif choice == '4':
subprocess.call("clear", shell=True)
noships.slhip()
subprocess.call("clear", shell=True)
elif choice == '5':
print("SubMenu..")
submenu.get_menu_choice()
else:
# int_choice = -1
print("Exiting..")
loop = False
subprocess.call("clear", shell=True)
print(get_menu_choice())
# return [int_choice, choice]
def weekOne():
def get_menu_choice():
subprocess.call("clear", shell=True)
def print_menu(): # Your menu design here
print(30 * "-", "Sub-Menu", 30 * "-")
print("1. InfoDB For Loop")
print("2. InfoDB While Loop")
print("3. Recursive")
print("4. Fibonacci")
print("*. Back to Main Menu")
print(73 * "-")
loop = True
# int_choice = -1 //debug thing
while loop: # While loop which will keep going until loop = False
input("press enter to return to submenu")
subprocess.call("clear", shell=True)
print_menu() # Displays menu
choice = input("Enter your choice [1-5]: ")
if choice == '1':
print("you chose number 1, the InfoDB For Loop")
infoDB.for_loop()
# int_choice = 1 //more debug
elif choice == '2':
print("you chose While Loop")
infoDB.while_loop()
elif choice == '3':
print("you chose number 3, the Recursive Loop")
# int_choice = 3
infoDB.recursive_loop(0)
elif choice == '4':
print("you chose number 4, the Fibonacci")
fibonacci.fibonacci()
elif choice == '5':
# int_choice = -1
print("SubMenu..")
else:
# Any inputs other than values 1-4 we print an error message
# int_choice = -1
print("Exiting..")
loop = False
subprocess.call("clear", shell=True)
print(get_menu_choice())
def weekTwo():
def get_menu_choice():
subprocess.call("clear", shell=True)
def print_menu(): # Your menu design here
print(30 * "-", "Sub-Menu", 30 * "-")
print("1. Factorial")
print("2. Triangular OOP")
print("3. Triangular Imperative")
print("*. Back to Main Menu")
print(73 * "-")
loop = True
# int_choice = -1 //debug thing
while loop: # While loop which will keep going until loop = False
input("press enter to return to menu")
subprocess.call("clear", shell=True)
print_menu() # Displays menu
choice = input("Enter your choice [1-5]: ")
if choice == '1':
print("you chose number 1, the Factorial")
num = factorial.__init__() # uses the above function to return an input
factorial.factorial(num)
# int_choice = 1 //more debug
elif choice == '2':
print("you chose Triangular OOP")
n = input("Enter a number: ")
n = int(n)
print(triangular.Triangle(n))
elif choice == '3':
print("you chose number 3, the Triangular Imperative")
num = triangular.getnum() # uses the above function to return an input
triangular.triangular(num)
# int_choice = 3
else:
# Any inputs other than values 1-4 we print an error message
# int_choice = -1
print("Exiting..")
loop = False
subprocess.call("clear", shell=True)
print(get_menu_choice())