On Mon, 14 Jul 2008 03:57:23 -0400
"Rod Pemberton" <do_not_have@[EMAIL PROTECTED]
> wrote:
> Odd, I always thought of it as an integer array task, i.e.,
> 1,2,...52..., where each number maps to a specific card: suit, color,
> rank, etc.
The individual cards are, indeed, represented by integers. However,
since the concept of suit is so im****tant in trick taking games, it is
more computationally efficient to use a pair of numbers for each card
-- one for the suit, and one for the rank. Furthermore, it is more
readable, and thus less prone to errors, to enumerate these values such
that one can write (spades, queen) instead of (3, 12). This also can be
done in most languages. And, of course, an integer array is a list of
numbers. So, up to this point, you and I are basically in agreement.
However, a single such list (integer array) is useless for making
decisions about which card to play. So one is constantly juggling
multiple lists, and this is why the list processing features of
Python make it a more appropriate language than C, for this task.
--
Chuck
http://www.pacificsites.com/~ccrayne/charles.html


|