Skip to content

Commit 8078e6a

Browse files
committed
Change prompts
1 parent aaf9af6 commit 8078e6a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Driver.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import os
23
from time import perf_counter as time
34
from Graph import Graph, compute_mst_and_cost
45
from LazyNaivePrims import prims_mst as lazy_naive_prims
@@ -22,6 +23,7 @@ def read_graph(grf):
2223
# Checking if input file is specified as command line argument.
2324
try:
2425
fname = sys.argv[1]
26+
print(f"You have chosen the test file \"{fname}\"")
2527
except IndexError:
2628
fname = input("Enter test file name: ")
2729

@@ -34,8 +36,8 @@ def read_graph(grf):
3436
exit()
3537

3638
def read_choices():
37-
implementation_choice = input("Which implementation(s)?\nlazy_naive, eager_naive, binary_heap, or fib_heap: ")
38-
display_choice = int(input("\nHow to display MST? 1. None,\n 2. Adjacency Matrix, or 3. Graph Visualization: "))
39+
implementation_choice = input("\nWhich implementation(s)? \nlazy_naive, eager_naive, binary_heap, or fib_heap \nEnter: ")
40+
display_choice = int(input("\nHow to display MST? \n1. None \n2. Adjacency Matrix \n3. Graph Visualization \nEnter: "))
3941
print()
4042
return implementation_choice, display_choice
4143

@@ -87,6 +89,7 @@ def display_mst(display_choice, grf, adj_mat, precursor, mst, cost):
8789

8890
def main():
8991
grf = Graph(representation = "matrix")
92+
os.system("clear")
9093
read_graph(grf)
9194
adj_mat = grf.graph
9295

@@ -96,4 +99,4 @@ def main():
9699
display_mst(display_choice, grf, adj_mat, precursor, mst, cost)
97100

98101
if __name__ == "__main__":
99-
main()
102+
main()

0 commit comments

Comments
 (0)