RichardBerg : TestprogramManual

FavoriteLinksCondensed :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings
TESTPROGRAMS:

Run the appropriate executable as detailed in the program README file.
Possibles are: 1) 'testdeck' 2) 'testbjhand' 3)'testsmart' 4)'testcount'

The only known dependencies are on the C Standard Template Library and the Tapestry class "randgen.h".


EXPLANATION OF TESTPROGRAM FUNCTIONALITY

The blackjack project includes four separate test programs that verify the function of the principal program. These programs are described below:

TESTDECK:

This program validates that a shoe generated by our class is in fact filled with a random assortment of cards. The first output line states how many decks are in the randomly generated shoe (a random number between four and eight is generated for this testprogram). Below is a scattering of the deck's cards (1=ACE, 13=KING). The last output is a map from card value to the number of cards of that value in the shoe that would be played. Since the deck is designed to stop play before it has been entirely dealt out (in accordance with modern casino practices), the number of cards of each type will not be 4*numDecks, but it will be close to that for most card values.

TESTBJHAND:

This progam tests the functionality contained in the bjhand class and part of the deck class. Randomly generated cards are used throughout this testprogram except when we're trying to demonstrate the functionality associated with a particular hand, such as a blackjack. The first output validates that the card constructor creates an appropriately valued card. The second output validates that the bjhand class correctly converts cards to their appropriate blackjack values (i.e. face cards = 10), and then that bjhand correctly determines the overall value of a hand. The third output tests the soft hand detection functionality. The first hand should always be deemed soft, since it has one ace and one randomly generated card. The second hand should never be deemec soft, since it has an ace but other cards force the ace to take a value of 1. The fourth output demonstrates that a bust will be detected correctly by evaluating a hand of value >= 22. The fifth output shows that a blackjack and 5-card-train (both artificially created hands from non-random cards) will be detected and valued appropriately. The sixth output demonstrates the correctness of the split and other related functionality by evaluating non-random hands, one of which has an artificially inserted split.

TESTSMART:

This program validates the function of the smartstrategy class and all of the associated subclasses of the play class (i.e. all of the play sublasses beginning with "bsc"). The testprogram creates a random player's hand and a random dealer's hand. It then outputs the player's hand and the dealer's up card, as well as what the player will do according to the basic strategy utilized in the smartstrategy class. By cross-checking the player's play (which is returned as an int...see the rules class for a defintion of what each int represents) with the strategy tables found under "Basic Strategy" in Lawrence Revere's "Playing Blackjack As a Business," one can validate the correctness of the smartstrategy class.

TESTCOUNT:

This program validates the function of the countstrategy class and all of the associate subclasses of the play class (i.e. all of the play subclasses beginning with "rev"). It also tests the implementation of the player class. Since this testprogram demonstrates the functionality of a card-counting class, it also tests the showCards function (and all associated functions) that are defined in the strategy superclass, in addition to testing to board class and its associated functionality.
The first output in this testprogram is analogous to the output of the TESTSMART program. It shows the player's cards, the value of the hand that those cards add up to, the dealer's up card, the present raw count, the present true count (based on a 2 deck game), and the appropriate play for such a situation. Looking at the tables found under "Revere Point Count Strategy" in Lawrence Revere's "Playing Blackjack As a Business, " one can confirm that the plays are correct for each given situation.
The second output demonstrates the internal working of a count strategy system. We use the following specific play as an example: player has an 8 against a dealer's 4. If the true count equals or exceeds +6, the player will double down. Otherwise, the player will hit. The first several lines demonstrate what the player will do when the true count is relatively close to zero. I control for this situation easily, since the strategy has only been passed a few cards, so the absolute value of the true count cannot be very great. Before the cards are dealt, the player must choose a bet, which will be low because the true count is not high. This is demonstrated in the output. Then the cards are dealt (we fixed the board so that the player has an 8 and the dealer shows a 4). On a low true count, the player will hit, not double. We then pass the strategy a bunch of low cards to artificially raise the true count and perform the same experiment again. The player chooses a very high bet due to the favorable true count. We then deal the same fixed hand to the player and the dealer. This time, due to the high true count, the player will double, as shown in the output.

Back to BlackjackDesign

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.4
Page was generated in 0.2761 seconds