[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DL] Card Dealer



I began long ago to work on a C++ card drawer, I'll have to find it again.
It was drawing cards, and could give the best hand possible (for hexes)

It is on http://vvandeme.free.fr/Deadlands/ in the Playing Poker/Playing
section
(the direct link is http://vvandeme.free.fr/Deadlands/CardDraw.zip).

I can also send it to anybody privately.

The final aim was to make a software for marshalls to manage a posse. But I
stopped being marshall for a long time, and almost stopped playing
Deadlands. So, the manager is far from ready.


>I don't know VB, but here's an easy way of doing it:
>just keep a list of all the cards that have been drawn.

An even easier way to do this is to have an array of "card" (which can be
represented by an integer between 1 and 54, or 0-53). Initialize the array
with array[i] = i, and then shuffle the deck of cards by changing position
of each card once (this is enough to make a fully randomized deck of card.

Then, keep an integer which is the next card to draw, and increase this by
one to draw the next card.

This is the way my card dealer works. It is one of the smallest
representation for a deck of cards (using characters instead of integers, in
C/C++).


Vincent Vandemeulebrouck
The French tinhorn with a Great name
====================================
http://vvandeme.free.fr/Deadlands/


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com