CPTS 253

Spring 2000

Assignment #2 Multi-player Card Game Simulation

 

 

 

Date Assigned: Feb. 7, 2000

Date Due:  Feb. 17, 2000

 

Overview: You are supposed to extend the card game example in the textbook (also in the handout) to multi-player version with slightly complex rule. For this assignment, you are required to use either subclassing or interface of which specification is given below.

 

Game rule: A game consists of a number of rounds between N players. At the start of each game, the equal number of cards is handed to N players. Obviously this is simply 52/N. The remaining cards are turned face up and put on the card table so that every player can see them. In each round of a game, each player plays a single card in turn. You should randomly choose the first player of the first round. This player decides lead suit of the round by playing a card of his choice. The player who plays the highest card of the lead suit wins a round. The winner of each round plays the first card of the next round. Naturally a player who wins the most round is the winner of the game.

 

Player strategy: Players are constantly faced with several decisions to be made in every round.

 

Requirement: