2 years ago 2 years ago Games Share

Fast Draw – A Commodore 64 Poker Machine

Play this poker machine emulation online in your web browser! This page was an experiment to see if I can get some of the vintage computer games that I wrote years ago, before there was even internet, to run in a web browser.

You can also play Fast Draw in a different Commodore 64 emulator, also on Codewiz.au, on this page. The other version (and not the one on this current page) will work better on a phone or other device (e.g. a tablet) with no physical keyboard to type on.


Instructions

Click the button above to boot the Commodore 64 Emulator into the game.

Press the "C" key to add coins, as many as you like (since they aren't real money).

As long you have at least one coin in credit, you can play. Press a number from 1 to 5 to bet that many coins (assuming you have that many left).

You will be dealt five cards (as in a standard game of draw poker).

Choose any combination of the five cards to discard, and then press "D" for your second deal.

The hand you get on the second deal is the final one. If you get "two pair" or better, you win. Otherwise, you lose. The number of coins you win is displayed in the table.

When you win a hand, you can choose to either keep your win, or "double up". If you double up, you get to guess whether the next card will be red or black. If you get it wrong, you lose the entire hand. If you get it right, your win doubles, and you can again choose to keep your win or double again. You can double up to a maximum of five times.

IMPORTANT SAFETY WARNING: I was much younger when I wrote this, and it was really only ever meant to be played by myself and friends. When you lose at the double-ups, the game will give you random insults. Some of them might seem a bit harsh.

Good luck!

Phones and Tablets

I don't think this version supports devices with no physical keyboard, but the other version does, sort-of.

Bug Hunting — Random Number Generator 🐜

There is a bug in this version of the game. I might fix it sometime. Though, Codewiz.au is primarily meant to be a Cyber Security (and coding and networking) website, not a gaming website.

These kinds of bugs in random number generation have real consequences in the world of Cyber Security. One of these is that random numbers play a critical role in cryptography. Which means that when random numbers end up not being as random as the programmer expected, it can lead to ways to crack the encryption. In the past this has led to many security breaches.

The consequence of the bug here is that in the current version of the game, every time you boot it, and then start playing it, you will always get the same sequence of cards dealt!

You can even learn by trial and error (and lots of rebooting the game), and then memorise (or write down) the correct sequence of "guesses" in the double-ups, to really cash in.

You can resolve the bug manually by pressing ESC to break out of the game, then pressing the Enter key enough times to end up on a blank line (if you aren't already on one). Then type in PRINT RND(-TIME) and press Enter. There is a minus sign (i.e. a hyphen character) before the word TIME). That will seed the random number generator with a value based on how many 60ths of a second have passed since the game was booted. Then type RUN and press enter to restart the game — and the cards should be dealt much more randomly now.

If you don't like typing much, ?RND(-TI) will also work.

You need to do this after booting the game (and not when it's still showing the blue screen). Booting the game (by clicking the button) will replace the entire RAM of the emulated machine with the snapshot that has the game loaded into it, including all the other values in its entire 64 Kilobytes of RAM (and including the seed value for the random number generator).

Rather than fix the bug (which would basically involve adding the above line of code to the actual game, and in a place where the "RAM snapshot" version of this game will find it), it seems more educational to leave it in, and then explain how you can "hack" your way around the bug (as has been done here).

I recently edited the other version of Fast Draw on this website (click here to see it), so that (I think) it doesn't have the random number bug.

How It Works Internally (Source Code, etc.)

If you press the ESC key (which emulates the BREAK key on the Commodore 64) while in the game, the game will stop. Then if you press Enter/Return several times, till you end up on a new blank line, then type LIST and press enter to see the BASIC language source code.

You can even edit the source code (if you can figure out how to do the editing in Commodore-64 style) and type RUN to start the game again (assuming you haven't messed up the code too much).

If you do mess it up, you can always just click the "Start Playing Fast Draw" button to reboot the game.

A much better description of the code and how it works will go on this website sometime soon. Plus other formats which you can download and play on other emulators.

Categories Games,Lifestyle,Vintage
Byte.Yoga Homepage - Australian Cyber Security Web Magazine

Share This Page

If you liked this page, please share it with others! You can use the links to share on Facebook, Twitter, LinkedIn, Pinterest, and Email. Ther is also an RSS feed to get updates for the website.