May 18, 2012, 02:07:29 AM
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to DotaCash! Click here to watch DotACash Livestreams!
 
   Home   Help Search Calendar Staff List Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Simulating a game (like blackjack) ?  (Read 77 times)
0 Members and 1 Guest are viewing this topic.
Stromae
FM Sub-Admin
DotaCash Legend
****
Offline Offline

Posts: 15121

Player Validated:
down_trotting
uswest.battle.net
TSR: 41.25
Tier 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.
« Last Edit: February 21, 2012, 02:52:33 PM by RollingStoned » Logged

My goal is to not get sigged.
I feel qualifed for a chance at a spot as Game-Master of Dota Cash website.
Phantom_IV
FM Admin
Legendary Member
*****
Online Online

Posts: 4457

Player Validated:
lgd.zsmj
useast.battle.net
TSR: 136.81
Tier 2 ELO: 1000


Rawr.


« Reply #1 on: February 21, 2012, 06:28:10 PM »

There's blackjack optimal strategy here:  http://www.blackjackencyclopedia.com/blackjack-strategies.html

I've heard that the dealer is still a slight favorite even with this, but it's very slight.
Logged

Thanks to Ichi for the sig!

I'm very approachable; feel free to PM me if you have any questions.
Stromae
FM Sub-Admin
DotaCash Legend
****
Offline Offline

Posts: 15121

Player Validated:
down_trotting
uswest.battle.net
TSR: 41.25
Tier 2 ELO: 0


« Reply #2 on: February 21, 2012, 11:58:30 PM »

I know the graph ^_^

I'm more interested in figuring out how to code this and figure out the %'s.
Logged

My goal is to not get sigged.
I feel qualifed for a chance at a spot as Game-Master of Dota Cash website.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 2.533 seconds with 20 queries. (Pretty URLs adds 0.959s, 2q)