You are browsing as a guest. Sign up (or log in) to start making projects!

4h 24m 27s logged

Day 3 - Getting somewhere!

It’s been a while since my last devlog. Since then, I spent all the time working on the delay between each swap of rectangles. I know that it sounds silly but I really didn’t know how to do it.. But now, I managed to solve it and now it works!

What was the problem?

The problem was that, to start the sorting algorithm, I would press a button and it would call the sorting function. But.. once it starts, it does everything in ONE frame, instead of waiting for the delay I set.
So once I understood my mistake, I rewrote the algorithm in the exact same way but in a step-by-step style, without using any kind of loops.
Now, thanks to this new approach, I managed to add a delay between the swaps!
Thanks to this, I even managed to add a simple animation when the sorting is completed!

Next features

The next features that I’m working to add is:

  • More algorithms (of course), but to add them I wanna do something special.. Since this project is a way for me to learn to code better.. I’ll add the other algorithms and the bubble sort in other files and I’ll call the actual functions inside the main.cpp. So they’ll become something like libraries. This is a way to maintain the code clean and even a way for me to learn how to connect multiple files between them!
  • A display box to show a quick description of how the algorithm works and even the pros and cons! (I don’t know if I can but I’ll try).
  • A way to compare stats of the sorting algorithms
  • A slider to choose the speed of the sorting algorithm
    Then I don’t know.. I thought of something else but I forgot.. lol.

Anyway thanks for reading this new devlog and see you onto the next one!

Here’s finally a quick video demonstration of the software in function!

0
2

Comments 0

No comments yet. Be the first!