      ===== Simulating Blackjack with optimum strategy =====
simbj is a program using the algorithm for calculating the probabilities and
expectation. It plays against itself. It may be used to simulate games in
a real environment. A dealer, a "beating" player and other gamblers are simulated.
First the player makes his bet, according to the strategy calculated.
Then the dealer draws a card, visible to everybody. Afterwards other gamblers sitting
in front of the player do their game. Next the players does his game according
to the strategy. And finally the other gamblers and the dealer finish their game.
Don't expect the program cheats anybody, even if the it could peek into the shoe to
modify its strategy, it does only use informations visible for everyone. simbj only
counts which cards are gone and calculates the total expectation before each
game to determine the stake. During the game, simbj calculates the optimum
strategy for playing and buys or stands, doubles or splits accordingly.
However a few parameters may change from casino to casino. These parameters
are asked before You run a simulation. If You accept the default parameter,
just hit enter, else type the desired number.

Number of packs in the shoe (default is: 6)?
    This sets up the shoe with 6 packs of cards, ie. 6*4 aces, 6*4 twos and so on.

Percentage of gone cards, after which the shoe is reshuffled (default is: 85)?
    After 85% of the cards in the shoe are gone, the dealer reshuffled them.

What is the minimum bet (default is: 10)?
    The casinos lower stake limit is 10 money units.

What is the maximum bet (default is: 500)?
    The casinos highest stake limit is 500 money units.

What is the initial capital (default is: %d)?
    The players initial capital.

How strongly should the bet increase with a total expectation above 0 (default is: 250)?
    With a total expectation below 0 only the minimum stake is set.
    In a few games (specially towards the and of the cards in the shoe), were the
    total expectation may increase above 0, the stake is increased. This number say by how much
    the stake is increased. For instance, if the total expectation is 1%, the stake would be
    250 money units. 

How many gamblers are sitting in front of You (default is: 2)?
    Seven players can play against the dealer. Two of them are sitting before Your
    turn ...

How many gamblers are sitting in behind You (default is: 1)?
    ... and one is sitting behind You.

After You have answered, simbj starts to shuffle the cards and the dealer
takes a card visible to everybody. After that, You the other gamblers and
the simulation player do their games. This may look like:

---- game: 38 capital: 8630 (min: 8275, max: 10035, expect:  10085) ----
dealer: 9 9 = 18 
other0: 6 6 10 
other1: 10 7 
player: 10 ACE = BLACKJACK --> win 3 for 2
expect:  2.699%, bet: 500, gain: 750
other2: 4 10 6 

You can read: This is game number 38, the players
capital is 10040, the minimum capital was 8275, the maximum 10035.
The theory says, the players capital should be 10085, which is 
the sum of all the total-expectations by the stake.
The total expectation is 2.699%, so the players stake is high: 500.
The dealers first card is 9 the result 18, the players
result is Blackjack, he wins 750.

---- game: 133 capital: 7395 (min: 7395, max: 10050, expect:  10070) ----
dealer: 8 9 = 17 
other0: 6 10 4 
other1: 10 10 
player: 9 4 10 = BUST --> loose
 split: 9 2 5 (doubled) = 16 --> loose
expect: -0.429%, bet: 10, gain: -30
other2: 3 2 10 7 

You can read: This is game number 133, the players
capital is 7395, the minimum capital was 7395, the maximum 10050.
The theory said, the players capital should be 10070.
The dealers first card is 8. The players stake is 10. 
The player splitted his cards, and doubled on the second
split.

This simulation will work forever or until all the capital has been lost.
Note that on the long term the capital should oscillate around the expected
capital. The expected capital only tells You the average of how much the capital
should be.

Even if on the long term You may beet the dealer, this program shows that
there is a high risk to loose all of the initial capital and that the average
hourly wage is quite low. I would therefore suggest to everybody heavily interested
in changing his job into a professional Blackjack gambler, to think about
it twice. For my point of view there are better possibilities for doing its earning.


