LucasPilla / Sorting-Algorithms-Visualizer

Program made with Python and Pygame module for visualizing sorting algorithms
MIT License
426 stars 164 forks source link

Bogo sort not working properly #163

Closed shivamAmrutia closed 1 year ago

shivamAmrutia commented 1 year ago

i recently cloned this repo to understand it better and was going through the app when i noticed that the bogo sort gif was not working properly

while sorting

it was stuck at the first parts of the given values

bogo-whiles

after sorting

it gave unsorted results

bogo-sorted

i tested this for a few times to make sure

i think it is because of the infinite upper limit here

i would like to work on this issue, kindly waiting for feedback from contributors

LucasPilla commented 1 year ago

@shivamAmrutia Actually the bogosort isn't expected to work 🤣. It's just a random algorithm.

https://github.com/LucasPilla/Sorting-Algorithms-Visualizer/blob/7ee00c35dcbabb1fd6f20e1bdb04a8bae8d50e9a/src/algorithms/bogoSort.py#L4-L12

Btw, i should remove it. You can do it if you want.

shivamAmrutia commented 1 year ago

Alright i think i will just add some text that is triggered when time limit is exceeded 😅 , looks better ig

LucasPilla commented 1 year ago

@shivamAmrutia You could just delete it, it's there just for the meme 🤣

lucasrafaldini commented 1 year ago

Hey, guys. Do you think deleting is the best alternative? I'm not sure about that because either its a meme or not, it has a name and a method and both are common conventions, so I think it's nice for beginners to (at least) know what this sh*t is at all lol

I mean... This repo isn't just about visualising the algorithms but also about reading its docstrings and understanding how its implemented and for what ends it is being used for (or not). So, deleting it would make it less complete, don't you think?