G6DOOS Coursework 1 - Joanne Carter (jxc04m) ------------------------------------------------------------------------------ | | | BBBBB L A CCCCC K K J A CCCCC K K | | B B L A A C K K J A A C K K | | BBBBB L AAAAA C KKK J AAAAA C KKK | | B B L A A C K K J J A A C K K | | BBBBB LLLLL A A CCCCC K K JJJJ A A CCCCC K K | | | ------------------------------------------------------------------------------ How to Play: ------------ To run the game you need to be in the folder that the game is saved in, and type "blackjack" at the command prompt. The Rules: ---------- * The object of the game is to get 21, or be the closest to it without going over. * You, the player, are dealt 2 cards face down and the dealer is dealt 1 card face up. You then get the choice to take a card (twist) or stay (stick) with what you have. If your hand totals over 21 then you are bust and you lose your bet. If you don't go bust then the winner is the one with the highest hand (or if it's a draw you get your bet back). * You can keep playing until you choose to quit, or your pot goes below £0. Extra Rules: ------------ * An Ace is either valued at 11 or 1, depending on the value of your hand. * If you get 21 in just two cards, then you get a Blackjack and win back 2.5 times your bet (unless the dealer also gets a Blackjack, in which case it is a draw). * If your initial hand totals between 9 and 11 then you have the option to doubledown. This means that you can double your bet on the hand, but you only get dealt one more card. Then the winner is again the player with the highest hand. (Note: you can only doubledown if you have enough money in your pot to double the bet). * If you are intially dealt 2 cards of the same value (except for 10's and 5's), then you can split your hand, creating 2 hands which can be played as normal (Note: if you split Aces you can only get 1 more card dealt on each hand). You can split your hand a maximum of two times, which means you could have a maximum of 4 hands. (Note: You can only split if you have enough in your pot). The Program: ------------ This program has been tested on Unix via Exceed. It could possibly be recompiled to work with windows, but this has not been tested. The program has been designed with 3 classes: shoe, card and hand. Both shoe and hand contain cards. The main program creates a shoe, then a hand for the dealer and at least one hand for the player (a vector of hands etc is created). The Files: ---------- CW1/blackjack (the main program) CW1/blackjack.cpp CW1/blackjack.h CW1/card.cpp CW1/card.h CW1/hand.cpp CW1/hand.h CW1/readme.txt (this file) CW1/shoe.cpp CW1/shoe.h (the original shoe.h, with added headers - other code unaltered.) Features Implemented: --------------------- * The basic rules * A dealer * 1 player * Betting * Blackjack * Soft Aces * Doubledown * Split (max 4 hands) Compilation instructions (Unix): -------------------------------- If you should need to (re)compile this code, then you will need to be in the same folder as the binaries, and type "g++ -o blackjack blackjack.cpp shoe.cpp hand.cpp card.cpp" at the command prompt. A Note: ------- I have used a '£' for the pound sign instead of a \u (Unicode) value as this seems to work perfectly on the University systems via Exceed.