Random No Repeats with Large Numbers
architectpianist
Member Posts: 21
Hi,
I have 48 cards in a game I'm making. They're split into two groups of 24 for each player, then two groups of 12 for black and white, and two sets of 6 of identical cards.
I need to shuffle the cards and deal them on the board like checkers pieces, zig-zag-style. I looked at tshirtbooth's random no repeats how-to, but it doesn't seem efficient in my case to use 24 attributes and assigning each one random numbers and checking each one for each attribute, etc. etc. etc. It adds up to a lot of rules. So I need a more efficient way to deal random cards with no repeats.
Thanks!
I have 48 cards in a game I'm making. They're split into two groups of 24 for each player, then two groups of 12 for black and white, and two sets of 6 of identical cards.
I need to shuffle the cards and deal them on the board like checkers pieces, zig-zag-style. I looked at tshirtbooth's random no repeats how-to, but it doesn't seem efficient in my case to use 24 attributes and assigning each one random numbers and checking each one for each attribute, etc. etc. etc. It adds up to a lot of rules. So I need a more efficient way to deal random cards with no repeats.
Thanks!
Comments
When ALL conditions are valid:
--self.CardValue = 1
--game.1 < 2
----When ALL conditions are valid:
------actor receives event touch is pressed
--------change image
--------change attribute "game.1" to "game.1 + 1"
So the problem now is that some cards do not respond to touch, presumably because their game attribute is higher than one. I thought of assigning CardValue another random number in the "Otherwise" section, but it would need to run through every rule again. Is there a way I can tell the compiler to go back to the beginning of the rules and check with a new random number?
When ALL conditions are valid:
actor receives event touch is pressed
self.CardValue = 1
game.1 < 2
change image
change attribute "game.1" to "game.1 + 1"
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps