-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading a sortType that doesn't exists stops the program #2
Comments
There's great temptation to over-engineer a solution to this. I can handle this too I believe, if you would like me to. |
I was thinking about reusing My first thought was to reuse it by checking if the length of the return (string) is higher than 2, because the number of algorithms will probably be less than 99, and use that as a validation when starting the sort process or changing the algorithm. Also adding a different function or variable containing the number of algorithms will be another step into adding new algorithms. I don't want to over complicate this, but maybe there are better approaches to solve this issue! |
I had similar thoughts of using a sentinel value, and then hiding that with a simple function to check. c: Something similar to:
While in main.cpp
What are your thoughts? |
Awesome! Go ahead if you want |
PR #5 fixed this issue, now you can't select a non-existent algorithm, closing this issue. Thanks! |
Describe your problem:
When you try to select a sorting algorithm that does not exists and load it, the program just stops and can't do anything. Restarting the program solves the issue.
Steps to reproduce:
Possible fix (optional):
Make sure that
sortType
it's associated to a sorting algorithm insf::Keyboard::Up
andsf::Keyboard::Down
events, inmain.cpp
OS
The text was updated successfully, but these errors were encountered: