issues
search
LucasPilla
/
Sorting-Algorithms-Visualizer
Program made with Python and Pygame module for visualizing sorting algorithms
MIT License
418
stars
153
forks
source link
Added comments to main.py and removed hardcoded values from display.py to globals.py
#183
Closed
hlai1
closed
6 days ago
hlai1
commented
9 months ago
Changes
added comments to main.py to increase readability
removed the hardcoded values from display.py (numBars, delay, time_taken, etc.) and moved them to globals.py
imported hardcoded values from globals.py to display.py for usage
Why (resolves
https://github.com/LucasPilla/Sorting-Algorithms-Visualizer/issues/176
)
Increases readability of code
Makes code cleaner and more module
Global definitions are easier to reuse across multiple modules
How
Went through main.py to understand logic, then commented the file
Created globals.py file, moved the hardcoded values from display.py over
Imported the values from globals.py into display.py for usage throughout the file
Testing
Ran the data visualizer again, confirmed that functionalities still operated the same as before (timer, switching sorting types, etc.)
Changes
Why (resolves https://github.com/LucasPilla/Sorting-Algorithms-Visualizer/issues/176)
How
Testing