Table Display Question
Fal01
Member Posts: 460
Hi all,
I'm trying to make a word game and I have 12 words per column in my table and I want to be able to display them in 12 seperate boxes in the game.
How do I display them all randomly without repeating any?
I've tried using random but it repeats a few every time.
I'm trying to make a word game and I have 12 words per column in my table and I want to be able to display them in 12 seperate boxes in the game.
How do I display them all randomly without repeating any?
I've tried using random but it repeats a few every time.
It’s not a bug – it’s an undocumented feature
Best Answers
-
tatiang Posts: 11,949http://forums.gamesalad.com/discussion/53553/demo-randomize-table-rows
http://forums.gamesalad.com/discussion/55060/fisher-yates-in-place-shuffle-for-gamesalad-quickly-randomize-a-large-table-column
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949There's a behavior that does Change Attribute self.n to tableRowCount(tableName). self.n represents the size of the array (the number of table rows). If you have 12 table rows, it will shuffle 12 rows. The DisplayText actor has a static number of rows entered in as an example. I wasn't going to create a demo that would display 500 rows, etc. But if you have separate actors, each actor would have a single DisplayText tableCellValue(tableName,row,1) behavior where row is the number of the row you want to display.
I actually can't explain in laymen's terms how it works. I don't fully understand it myself. I took an algorithm and translated it into GameSalad rules. But you can read more about it in the link in the actor's notes (http://en.wikipedia.org/wiki/Knuth_shuffle).New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
It’s not a bug – it’s an undocumented feature
It’s not a bug – it’s an undocumented feature
I can't seem to get this to work for me.
Please could you explain in laymen's terms (for dummies!) what this is doing, and how to display them in 12 separate actors rather than as a list.
I swapped out your a-j list for my words and added another couple of words to make it up to 12, but it still only displays 10.
I can't see in the rules where it is telling it just to display 10.
Thank's in advance for any help!
It’s not a bug – it’s an undocumented feature