forked from scheng95/cs51finalproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.py
35 lines (27 loc) · 892 Bytes
/
menu.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
import os, sys
systemName = sys.platform
directoryAddress = os.getcwd()
def directorylist_python(dirAddress):
dirlist = []
for file in os.listdir(dirAddress):
if file.endswith(".py"):
dirlist.append(file)
return dirlist
directoryList = directorylist_python(directoryAddress)
directoryList.remove("menu.py")
problemNames = ["Hospital Resident or Stable Marriage", \
"Stable Roommates", \
"Maximum Cardinality Bipartite Matching", \
"Min Cost Max Flow", \
"Maximum Weight Perfect Matching", \
"Max Flow"
]
directoryList.sort()
print("\n\nMENU for CS51 Final Project\n")
counter = 0
while counter < len(problemNames):
print("("+str(counter+1)+") " + problemNames[counter])
counter += 1
problemNum = int(input("\nWhich problem would you like to solve? (Type a number.) "))
problemFile = directoryList[problemNum - 1]
os.system("python " + problemFile)