Video Poker Takes Your Money In 10 Lines Of BASIC – Hackaday

Posted: March 27, 2024 at 1:12 am

It wasnt easy, but [D. Scott Williamson] succeeded in implementing Jacks or Better Video Poker in 10 lines of BASIC, complete with flashing light and sound! Each round, one places a bet then plays a hand of 5-card draw, hoping to end up with Jacks or better.

This program is [Scott]s entry into the 2024 BASIC 10 Liner Contest, which at this writing has concluded submissions and expects to announce results on April 6th 2024. Contestants may choose any 8-bit computer system BASIC, and must implement their program within ten lines of code (classically limited to 80 characters per line, but there are different categories with different constraints on line width.)

Weve seen impressive 10-line BASIC programs before, like this re-implementation of the E.T. video game. (Fun fact: while considered one of the worst video games of all time, theres a compelling case to be made that while it was a flop, it was ahead of its time and mostly just misunderstood.)

These programs dont look much like the typical BASIC programs many of us remember. They are exercises in information density, where every character counts. So were delighted to see [Scott] also provides a version of his code formatted and commented for better readability, and a logical overview that steps through each line.

He spends a little time talking about the various challenges, as well. For example, hand ranking required a clever solution. IFTHEN conditionals would rapidly consume the limited lines of code, so hands are ranked programmatically. The 52-card deck is also simulated, rather than simply generating random cards on the fly.

The result looks great, and you can watch it in action in the video, just under the page break. If this sort of challenge tweaks your interest, theres plenty of time to get started on next years BASIC 10 Liner Contest. Fire up those emulators!

Go here to see the original:

Video Poker Takes Your Money In 10 Lines Of BASIC - Hackaday

Related Posts