Lolrus.org

This is a header that goes on every page.

More BlackJack

August 08, 2006 at 12:02 AM | categories: Computer | Comment

I finished adding splitting and doubling.

It works great so far.  Now I am going to run tests to see the best move for each hand.  There are really only about 200 different scenereos.  Let me explain.

The dealer can have 10 different cards (values) showing.  2-A.  You always want to hit if you have below a 9 (simple logic) and you always want to stand if you have 17 or greater.

It will first start by testing 16 versus the different dealer cards and work down.  (you need the higher ones to see what happens when you hit because it can become a higher combination).  After that it will go through all the soft ace hands.  Then it will test all the ones already done for doubling... and if it's a better option than hitting.  Finally it will test splitting.

I do need to modify (or extend) the deck and table class to "set up" these situations.  I'd say a few more days until I get around to writing the code.

I updated the repository with the new code.  There's also a README on how to run a simple test function (in case you want to try this at home)


BlackJack Ruby Simulator

August 07, 2006 at 02:22 PM | categories: Computer | Comment

It's been a few days, but I am back.

This weekend I was wicked bored so I decided to embark upon a new project. I started making a BlackJack simulator in Ruby. What it does is you extend the Player class and program it with different strategies for playing and it runs through n iterations and you can calculate the house edge from each strategy.

I have most of the game framework done, and a player class with a very simple strategy done. I still need to implement doubling and splitting though. I also extended the player class to UserPlayer where it asks for user input and is like a (very archaic) blackjack game. I really just plan on using it for testing to make sure everything is working as it should.

Dan W. suggested I extend it for network play eventually (which according to him, wouldn't be that hard), but I will put that last on my todo list.

Anyways, I have the code so far in a Subversion repository, here.

If you have subversion, just type in svn co http://ohpie.com/svn/BlackJack/trunk/

If you are interested in contributing, just let me know and I will give you write access to the repository.

More updates to come!


« Previous Page