>>>>> "EF" == Eric Fitzgerald <eric@stripped> writes:
EF> We are currently running a special prize give away promotion for
EF> our website. Every visitor that comes to the site is given an
I certainly hope you have the necessary legal paperwork done for your
EF> "Instant Win Card", or whatever the marketing guys wanted to call
EF> it. The card that they are assigned is random, and each card
EF> number has been pre selected on if it won a prize or not
EF> (something similiar to how scratch and win lottery is).
Wow... you're certainly shuffling a deck the hard way.
What you're doing is akin to having a deck of cards in some order.
Then when you need to give one out, you scan the contents of each card
to see if it has a mark in it that says "used". Then you pick one of
those cards by its position and mark it "used" and give a copy to the
person. Not very efficient.
Wouldn't it be much easier if you shuffled the deck at the start and
just handed them out in the shuffled order? Then your hard work is
done all at once before the game starts, and to hand out a card you
just pick up the next one on the stack.
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@stripped Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/