Demo: Randomize Table Rows

tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,948
edited February 2013 in Working with GS (Mac)
I got a little tired of using a method for extracting random table rows (e.g. randomly picking an image from a list of images, a question from a list of questions, etc.) that deletes a table row after choosing it, so I hit up Google and found a nice little algorithm. The source of the algorithm and the source of the time stamp loop (which I've posted about previously) are in the actor's notes.

Basically, this takes a table (currently 10 rows and only 1 column, but adaptable as needed) and randomly shuffles the rows "in place." I have not tested it extensively so if anyone has any criticisms or improvements, I'm all ears.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User


Sign In or Register to comment.