-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_interface.py
More file actions
34 lines (29 loc) · 1.15 KB
/
user_interface.py
File metadata and controls
34 lines (29 loc) · 1.15 KB
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
import tree_methods
while True:
command = input("Please select from the options below:\n"
"1) Create a new tree\n"
"2) Edit an existing tree\n"
"3) Visualize a tree\n"
"4) Print a tree's code\n"
"5) Write code manually\n"
"6) Print existing trees\n"
"7) Quit\n"
"Option Number: ")
if command == "1":
tree_methods.create_tree()
elif command == "2":
tree_methods.edit_tree()
elif command == "3":
tree_methods.visualize_tree()
elif command == "4":
tree_methods.print_code()
elif command == "5":
tree_methods.write_code()
elif command == "6":
tree_methods.print_trees()
elif command == "7":
print("Goodbye!")
break
else:
print("Yikes! Command was not found...")
#Tree("hello", [Tree("world", [Tree("it's",[]), Tree("me", [Tree("I was",[]), Tree("wondering",[])])]), Tree("if after", [Tree("cs61a", [Tree("you might",[]), Tree("take", [Tree("cs61b",[])])]), Tree("data structures",[Tree("are easy",[])])])])