I’ve authored a series for IBM developerWorks called 3d10 Game Scripts You Can Write With PHP. These scripts are simple utilities that can be used in various different types of games. I’ve provided working examples of the scripts linked below. To get the code for these scripts, you will have to view the Articles. Here is the link to Part One.
Part 1
- A Basic Die Roller – The working example of the simple die roller described in the article;
- Random Name Generator – Randomly generates alternating male and female names from a set list;
- Scenario Generator – Generates a basic RPG scenario from stock lists of situations;
- Deck Shuffler – Generates a basic 52 card deck and draws a random card;
- Odds Calculator : Card Draw – Given a pair of hands, calculates the odds of drawing a few specific cards;
- Simple Poker Dealer – Generates a deck, deals out five cards, and lets you pick which ones to get rid of;
- Hangman Generator – Creates a simple hangman game;
- Crossword Helper – Given a word of X length with Y known letters, provides some possibilities;
- Mad Libber – Creates a stock Mad Lib from a set list of words and a specific phrase;
- Lotto Picker – Looks at historical lotto picks (user entered) and specifies the 6 least picked numbers;
Part 2
- Damage Calculator – Create a table of weapons, and automatically calculate damage by each weapon
- Stat Tracker – Track basic character stats
- NPC Generator – Generate NPC characters automatically
- Odds Calculator : Die Roll – Work out the odds when rolling multiple dice
- Simple Blackjack Dealer – Practice playing Blackjack
- Card Counter – Use this as a basic Blackjack card counter
- Bingo Engine – Generate Bingo cards and draw numbers
- Jumble Helper – Unscramble a single word
- Substitution Cyphers – Create basic substitution cyphers
- Word Search Generator – Generate a Word Search automatically
Part 3
- Inventory Management – track inventory with your character
- Note Taker – take notes and track common terms
- ID Card Generator – use a template to create an ID card for your character
- Map Generator – dynamically generate a map for use in an RPG
- Poker Hand Evaluator – have a script evaluate your poker hand
- Slot Machine – Put together s simple slot machine
- Keno – try your hand at Keno
- Cryptogram Helper – get a little help solving the daily Cryptogram
- Mastermind – Play the old classic code breaking game
- Word Chains – create chains of words by changing one letter at a time
9 Comments | RSS |
Sorry, the comment form is closed at this time.

Hi there,
I have recently downloaded the Simple Blackjack Dealer from the IBM development website but I appear to be having a few problems fixing the bugs. Do you think you could upload an updated working copy or possibly email it to me? I will be most grateful,
Thanks
Comment by Dylan Martin
— February 18, 2009 @ 7:46 pm
Can you indicate what bugs you are running into, or what problem you are having?
Comment by Duane
— February 18, 2009 @ 9:24 pm
Whenever the player goes to hit I get this error
Warning: array_shift() [function.array-shift]: The argument should be an array in blackjack.php on line 80
And also when the player hits stay nothing happens, in the example on your site it shows what the dealer ended up getting.
Any help would be great!!
Thanks
Comment by Bevan
— May 17, 2009 @ 9:29 am
sorry….forgot to say im working with the blackjack dealer!
Comment by Bevan
— May 17, 2009 @ 9:30 am
I have the same problem with Dylan Martin. Can anyone help?
Comment by hui
— June 23, 2009 @ 9:33 pm
I’ve put up working text at http://aterribleidea.com/3d10/3d10-simple-blackjack-dealer.txt
Can you tell me more about what your problems are?
Comment by Duane
— June 24, 2009 @ 12:53 pm
I am trying to create a simple php blackjack game. I can show the cards image, but I am stuck at the hit and stand part, I cant hit the card appearing with the dealercard and playercard together. This problem has troubled me a long time. Should I create $_Session varaible to store the dealercard and playercard?
Comment by hui
— June 26, 2009 @ 11:12 pm
Can I ask what is inside the the file of include.php?
thanks
Comment by hui
— June 26, 2009 @ 11:23 pm
The include.php file just has the links that appear at the top of the scripts. No functional code.
Comment by Duane
— July 13, 2009 @ 10:43 am