Making a Blackjack program

netsurfer802's Avatar, Join Date: Jul 2009
Newbie Member
Hi I'm trying to either get or make a blackjack program that tests strategy over say a million hands etc and give me the wins or losses statistics of my systems over time.

If I'm going to make it, would prefer to get some pointers in making it with Excel, HTML or Visual Basic. I don't know the other programming languages well enough at all.

Thanks in advanced for any advice or pointers.
0
vikas1234's Avatar, Join Date: Aug 2008
Go4Expert Member
you can download the code .. making it from scratch would be tough .... go googling
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
I don't see that it would be particularly tough. All you need to do is find some representation for the cards, then pick two cards from a pack at random (making sure you don't pick the same card twice), then depending on your algorithm pick another card or stop, repeat until this terminates, see what the result was, then loop all the above 1,000,000 times and keep track of how many "wins" you get; that number divided by 1e6 will give you some kind of idea for how effective that algorithm is.

Additional complexities:
(1) does the algorithm involve card counting? If so then you can't pick two cards from a fresh pack each time, but every so often you will have to shuffle the discarded cards to make a new pile, or start with enough cards to cover all the hands in the simulation (say if a particular algorithm averages out to 3 cards/hand, then you need 3,000,000 cards or 57693 packs.
(2) does the algorithm involve other players and/or a banker hand? Again the number of cards will be affected by this.
(3) Or are the algorithms under test simple enough just to work by drawing cards directly from a fresh pile? If so then you only need one deck, of course.

Card representation is easy enough and you have several options including but not limited to:
- represent a card simply as a number from 1-52
- or as two numbers, one from 1-13 and one from 1-4
- or as two characters, say one each from A23456789TJQK and HCDS - 7 of clubs would be 7C; 10 of hearts TH and so on

Of course you can add stacks of complications to that, a graphical interface showing what's going on for instance, but that would really slow the simulation down and all you really want is the result of each algorithm.