generate non-repeat random table cell value until done
Does anyone know where a tutorial is to create this? I know it's a simple one, but I just can't make it simple.
Just one column of text values - say 5. Draw them out in random until complete - no repeat.
Just one column of text values - say 5. Draw them out in random until complete - no repeat.
Best Answers
-
gyroscope I am here.Posts: 6,598
Hi @Doguz and here's yet another way...
Basically, it's to copy the table, random row, delete that row, random row from rows-1, delete, etc., that way there's the guarantee of no repeats; and seeing as it's a copy of the table it's non-destructive. Hope you find it useful. :-)
P.S there's some redundant attributes, I think, so just ignore those not used... (of course!)""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
gyroscope I am here.Posts: 6,598
Love it. Thanks Gyro
Glad it helps. :-) It's very odd, but someone has deleted my post as well as the game file, for some reason....
Here it is again (I'm sure you've got your copy, @Doguz so for anyone else who might need it...)""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
https://dl.dropboxusercontent.com/u/27937751/gs/modules/RandomWithoutReplace_v1.0.gameproj.zip
And @fryingbaconstudios I took a look at that and maybe the code is nicer to pickout the random, but Gyros solution is the one I'm after. It pulls out a used cell so it wont be shown again.
And you would just have a rule that says when tableRowCount(tableName)=1, get the data and then change scene/end the game after that.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@Doguz How very strange.... I've no idea why that should happen... gotta be a Vanilla Forums bug for certain.... don't know if @SaladStraightShooter could confirm this and get it fixed, thanks....(that'd be appreciated, if so) :-)
In the meantime, I'll upload the file yet again.... but this time, don't worry about clicking Yes, see how long it stays!!!! :-))
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps