Skip to content

Commit b9d08d9

Browse files
committed
main() Recursion, Import Cleanup 🧼♾
1 parent 3ebec5a commit b9d08d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
from algorithms.heap_sort import heap_sort
1111

1212
# Miscellaneous Imports #
13+
from random import randint
1314
from rich.table import Table
1415
from rich.console import Console
1516
from animate_graph import camera
1617
import matplotlib.pyplot as plt
17-
import random
1818

1919

2020
arr_size: int = 30 # Size of the visualized array.
@@ -81,7 +81,7 @@ def main():
8181
# Array Creation: Create array for visualization. #
8282
arr.clear()
8383
for _ in range(arr_size):
84-
arr.append(random.randint(0, arr_size))
84+
arr.append(randint(0, arr_size))
8585

8686
# Algorithm Input Check: Check if the `algorithm_input` contains a valid algorithm, else quit. #
8787
if algorithm_input in ALGORITHMS.keys():
@@ -94,6 +94,7 @@ def main():
9494
# Animate #
9595
animation = camera.animate(interval=interval_time)
9696
plt.show()
97+
main()
9798

9899

99100
if __name__ == "__main__":

0 commit comments

Comments
 (0)