Rummy Game, Complete Application 400 Points
Posted on 2000-04-28
I need an entire program and here's the entire program description:
The game is called Rummy.
There are two players in the game, playing against each other.
Seven cards are alternately dealt face down to each player.
The remaining cards are placed face down on the table between them.
The object of the game is to have 4 of one kind of card, and 3 of another as in four kings and three queens or four jacks and three sevens. 4 hearts and 3 tens does not win.
The top card of the face down pile is turned over and placed face up next to the face down pile.
The player that was dealt the first card will go first.
Player 1 has the choice of either picking up the top card of the face up pile or picking up the top card of the face down pile. The other player knows the value of the face up card, but the face down card is kept secret, only known by the player that picked it up.
Now player 1 has 8 cards and must decide which card to remove from his hand. He can choose to discard the card he just picked up, or discard one from the hand. This card will be placed on the top of the face up pile. Player 2 now has to decide whether to pick the face up card up or choose one from the face down pile. This continues until one of the players has 3 of one kind and 4 of another and that player is the winner.
It must be simulated in 10, 50 and 100 tournaments.
Anyone has any thoughts on this, especially regarding the algorithms on deciding what card to discard and when they win.