On Jul 14, 12:57 am, "Rod Pemberton" <do_not_h...@[EMAIL PROTECTED]
>
wrote:
> "Chuck Crayne" <ccra...@[EMAIL PROTECTED]
> wrote in message
>
> news:20080713155223.7bdf4e52@[EMAIL PROTECTED]
>
> > For example, I have recently written an AI program for
> > playing the card game "Hearts". The game engine requires that such
> > programs be written in Python, which is a reasonable choice because
> > manipulating a deck of playing cards is essentially a list processing
> > task, which is one of Python's main strengths.
>
> 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
> program then only needs to track cards by number. When using integers,
the
> card characteristic (of most cards) can be found by modulo with the card
> number or by a few pre-computed lookup arrays. This method would work
with
> nearly any language (asm, BASIC, C, etc.) since they all sup****t
integers
> and arrays. But, many languages don't sup****t list processing that
well.
> I.e., would you rather use integers or strings in BASIC to process a
deck of
> cards?
>
> Rod Pemberton
It's possible to represent a stack of cards w/o an array or list.
After all, it's just the permutation number you need to establish the
order of the cards, which are all known. :)
Alex


|