Hi there,
Just want to know if there is other smarter way to sorting numbers in GDevelop, I just use the dumbest way…
Any help is welcome and appreciated, thanks in advance!
Hi there,
Just want to know if there is other smarter way to sorting numbers in GDevelop, I just use the dumbest way…
Any help is welcome and appreciated, thanks in advance!
Hi,
The easy way would be to wait for the array feature that should be coming, because it will allow such things, I believe.
The clever (harder) way is to figure out the algorithm.
For that, you must try to express with words the logic of what you’re doing to the list. It should start like:
Let X be a number that will go from 1 to 10.
Check if the score is greater than the score stored in position X of the list. If it is, do this and that.
And at the end, increase X by one and start over (until 10).
Once you have figured out all the details, you will use a repeat loop and structure variables to convert your words into events.
Hi Gruk,
Thanks for you reply!
As a newbie, I will try my best to understand your words ~
An array feature is arriving? Super!
You may try coding the “Bubble Sort” algorithm which is, I believe, the simplest sorting algorithm: Bubble sort - Wikipedia
Hi Tarsio,
I’ll try to understand it, thanks! ^^