Sorting Table
pokapola
Member Posts: 143
Hi, I'm still new to GS and currently I'm stucked with organising my table.
I have a table with only 10 rows,1 column. All the values in the table are real. I need those values (generated by users's action in the scene) to be organised from the lowest to the highest. The reason why I need it to be organised is that I need to do some calculation after (finding the differences between row(n)col1 and row(nt1)col1. It needs to be sorted first before the calculation.
It seems so simple in my head, but translating it to GS, not so simple for me. It has been like 3 days for me trying to figure out this table thing.
Any help or suggestion will be appreciated. Thanks.
Comments
Hi @pokapola What you need is a bubble sort algorithm - this has been covered quite a few times here in the Forums.
One that springs to mind, in particular, is the Bubble Sort file by @Armelline that you can download and check out here:
https://forums.gamesalad.com/discussion/70000/armelline-s-free-stuff-for-everyone
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Additionally, you can try this video tutorial I put up recently. It does pretty much exactly what you're looking for.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@gyroscope @braydon_SFX Thanks to both of you! I think for now I have to tinker with the bubble sort algorithm as the video tutorial only works for Mac right now, and I'm using windows. But in case I get stucked in tinkering with the algorithm (haha), I will fire up my VirtualBox and edit the scene using Creator for Mac.
Thank you for your help.
So..after a few hours of tinkering with the bubble sort algorithm..I decided to use the Creator for Mac on VirtualBox instead, LOL.
Thnaks guys.