Bet and Win in Stud, a Simple ZX81 Poker Game
A 100 in your pocket, you can take all, or blow it in this single card poker game.
For March’s program of the month, I offer up Stud. Written in 1984, it was my first computer card game. Calling it a card game is disingenuous as Stud is a simple high/low betting game. There are no rules or even a deck of cards. Yet simple can be fun in this random poker game.
An infinite deck of cards.
My goal when writing Stud was to create a graphic representation of cards. Based in part on my earlier dice games, Stud represents the cards as small squares. The suits aren’t quite right either, using the symbols available to me on the ZX81. Yet, it works well enough.
Game play wise, it can’t get any easier. Bet some money, and hope the cards go your way. And by cards, I mean yours is higher than the computer’s. The game continues until you’ve won the computer’s money, or you go bankrupt.
All looks, little substance.
Win or lose, Stud governs your destiny using the ZX81’s pseudorandom number generator. In fact, I use it twice to generate each card—once for the value, and again for the suit. Using a simple loop, the game stores the cards in an array.
As noted, there is no deck to shuffle. The game is random, making it more difficult than a real poker deck. No card counting here, the same card could, in theory, show up a dozen times. A real ZX81 isn‘t that random and would, without some nudging, generate the same sequence after each load.
The betting is actually logical. You always go first—not something a real game would allow, but it works here. Then the computer picks a random bet, but if lower than yours it will match it. I’m quite proud of myself for thinking about that.
The rest of the game is presentation. There is a lot of text to display, and Stud doesn’t shy from it. The cards, as simple as they are, make fair representations. It also uses
INKEY$ instead of
INPUT, a departure from some other games. Plus, it looks nice.
A few changes.
I did make a couple of changes from the original. Besides removing the “play again” option, it also runs on start. I also removed the glaring errors and spelling mistakes. You could also break the original game, so I added some error checking to avoid that.
As for future changes, there isn‘t much to improve on. Sure, you could make better looking cards, but they work well enough. You could actually create a 52 card deck to shuffle and draw from. Yet, that would slow the game down and isn‘t necessary here. Note, that it is possible to draw the same card. I leave it to you to fix that if so desired.
Now, if drawing more cards, then I would recommend adding a deck to avoid duplicate cards. But, in doing so I‘d say create a blackjack game instead. Or, if adventurous, try creating a poker game instead. Some ideas in this game are good, but you‘d be better off starting from scratch.