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.

Computer Win ZX81 screen shot, Stud by Steven Reid, 1984For 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.

2 Comments on this article:

Downloading Stud

Written on Mar 26, 2017 by Villordsutch

Hello Steven,

My name is Villordsutch and I was directed to your blog via the ZX81 Owners Club on Facebook. I have a YouTube channel in which I regularly look at old and new ZX Spectrum and ZX81 games.

I was looking to play Stud on my channel however I can't seem to find a download link for it, only an online playable version. Could you tell me if it's available to download so I could record a short video for it?

If you'd like to look at my ZX81 videos (I have 73 currently online) they're here -

Have a great day,


re: Downloading Stud

Written on Mar 26, 2017 by Steven

Hi Villordsutch. Thanks for stopping by. I used to include the link in each article, but it got to be a pain. If you head over to my ZX81 programs I’ve added a ZIP link to each program with the .tzx file—and maybe .p if I remembered to include it. I really should move these over to GitHub or some more appropriate location.

It’s cool to know there is still a ZX81 following out there. I’ll go checkout the Facebook page and your videos. Thanks for sharing!

Write a comment:

Type The Letters You See.
[captcha image][captcha image][captcha image][captcha image][captcha image][captcha image]
not case sensitive