[Javascript] Spades

Shawn Milo milo at linuxmail.org
Tue Jun 8 12:08:37 CDT 2004


Hello all,

I have recently been introduced to the card
game 'Spades', by my brother.  Apparently
it's pretty big in the Army.  Anyway, the
game is very interesting, and I'm thinking
about making a Javascript game out of it.

At the moment, the plan is only to have the
script calculate the bidding, and play all
four positions.  I am eager to see how
"smart" I can make it.  There are no plans
to allow one or more human players at 
the moment.

Has anyone had any experience with this?
I'm mostly interested on how others have
handled a deck of cards in JavaScript --
shuffling, etc.

Is there a royalty-free set of small
images of card faces?  I was just planning
on using "AS" for Ace of Spades, "3H" for
three of hearts, etc., but I may decide
to spruce it up, later.

I was planning on storing my cards in
an array with four elements:  suit, rank,
value, and status.  Suit is self-explanatory,
rank would be Ace to King, value would be
2 for two, 13 for the King, etc., and status
would be a zero for 'not dealt', one for 'held
by player one' (up to player four), and five
for 'already played'.

Handling the cards that way would also allow me to
have alternate cards rankings, such as the common
practice of removing the red twos from the deck and
adding the jokers, making the duce of spades, the low
joker, and the high joker, in that order, the 
highest-valued spades.

Any suggestions or ideas?  I think that this is going
to be fun.

Shawn



More information about the Javascript mailing list