QUOTE(Heimdal @ Oct 13 2006, 10:52 AM)
I really don't think any elegant solution to this would involve switches, because the number of choices you need to randomize between is always changing.
A cycling death counter is another good idea though.
[right][snapback]576151[/snapback][/right]
the 52 switches won't be for randomizing. i'm at school, i'll type all the info up when i get home.
ADDITION:
i don't quite feel like getting into the original programming inspiration for this, so i'll just tell you the basics.
the 52 switches each represent a card. 'cleared' means the card is still in the deck. 'set' means the card has been dealt. a counter set to 52 is required. the counter represents how many cards are in the deck. as a switch is set, the counter is subtracted by 1. there will also be a 'draw card' counter. it counts how many cards to not hand out before. its purpose will be more evident later on. there are some limitations to keep in mind, the counter must be less than the 'total cards' counter.
i'll post an example using only five cards:
p1 - deaths - zergling = how many cards to put out this trigger run(will always be one) ~~~ (may also be replaced with a switch)
p1 - deaths - marine = how many cards left in deck
p1 - deaths - ghost = draw card
*randomize draw card
__________________
Conditions:
switch 1 is cleared
p1 has suffered at least 1 deaths of zergling
p1 has suffered at most 0 deaths of ghost
Actions:
preserve
set switch
*output
subtract 1 death from zergling
subtract 1 death from marine
_____________________
Conditions:
switch 1 is cleared
p1 has suffered at least 1 deaths of ghost
Actions:
preserve
subtract 1 death from ghost
___________________________
*repeat for all five cards, simply changing the switch and adjusting output as necessary.
note: all this does is prevent you from drawing out the same card. randomizing the 'draw card' counter and dispalying output will be up to you.
think about this for a few minutes or even make a test map if you really need to. if you don't get it, i'll exlpain it in more detail.