Stromae
FM Sub-Admin
DotaCash Legend
  
Offline
Posts: 15121
Player Validated: down_trottinguswest.battle.net TSR: 41.25Tier 2 ELO: 0
|
 |
« on: February 21, 2012, 02:36:00 PM » |
|
How would I go about writing a program to simulate the game of blackjack, where the player and dealer have different requirements of when to hit, stay, double, surrender, split, etc. (Say a dealer has to hit if his hand totals 16 or less, if it's 17 or higher he must stay.... and then the player hits or stays depending on his total compared to the dealer's "first" (or up) card.)
I have a decent idea of how to do this if I wanted to run 1,000,000 random hands and see the output
The output of the simulation would be: -Percentage of each hand per up card (6-up gives: 15% 17, 22% 18, 23% 19, 20% 20, and 5% 21...then like 42% bust.....then the same for 5-up, 4-up...for A,2,3,4,5,6,7,8,9,10,J,Q,K.) -If "player" and "dealer" both abide by their own given rules (hardcoded), how often does player win compared to dealer, per up-card (ie: Dealer has 6-up, then the player wins 55% of the time.) -Any other kind of information.
|