Deliverable 1: Base classes for a Bluff Game

Download: Card.txt

Description:

The card game Bluff is generally called 'Cheat' in Britain and 'BS' or 'I doubt it' in the USA. One standard pack of 52 cards is used in the game. The aim is to get rid of all your cards by playing them to a discard pile. Since cards are played face down, it gives players the option to lie about the cards they are playing, but if the lie is exposed they must pick up all the cards in the pile.

In this game each player plays the next rank above the previous player. ie, The first player must discard Aces, the second player discards Twos, the next player Threes, and so on. After Tens come Jacks, then Queens, then Kings, then back to Aces, and so on.


The Deck as seen by the user is represented by their names as: AceofSpades, TwoofSpades, ThreeofSpades, ..., KingofDiamonds.
Internally, each card is assigned a number from 0 for AceofSpades, 1 for TwoofSpades and so on to 51 for KingofDiamonds. The cards(or numbers) are permuted randomly to ensure none of the players get any advantage over the other.
The objective of this deliverable is to implement the Card class which is the base class for the game. The main logic starts from the Driver class which calls the Card class to establish the deck and also performs random permutation on it.