This is a Go port of "Acey Ducey", based on the 1978 edition of BASIC Computer Games (BGC) from Creative Computing.
https://www.atariarchives.org/basicgames/showpage.php?page=2
NOTE: The game is actually "Acey Deucey", and sometimes called "In-Between". "Acey Ducey" is simply the spelling used in BCG.
Just getting used to Go. When BASIC was a thing, this was the first code I ever typed in and debugged. So why not in Go?
This version follows the original book listing's logic and rules. Note that the book deviates from more traditional card rules, as found on the Bicycle Cards website or Wikipedia.
flowchart TD
A[Introduction] --> B[Your money remaining]
B --> E[Draw dealer cards]
E --> F[Display cards]
F --> G[Get bet]
G --> H[Draw player card]
H --> I[Evaluate player card]
I --> Y[Try Again?]
Y --> |Yes| B
Y --> |No| Z
Z[END]
You get the picture.
go run main.go
NOTE: Requires Go v1.20+ (has math/rand with seed auto-set).
Because the original code has bugs (or undocumented deviations from In-Between's ruleset), and it is spaghetti BASIC GOTO code (not even using subroutines), I had to step through it on paper. I also wanted to outline flow with mermaid-js.
When I was nearly done, I found the epic Something Awful BCG code review thread. It's a great read, and steps through a few of the other BCG listings. A pity the thread ended.
Bill Palmby of Prairie View, Illinois wrote the original version in BCG.
Public domain, as was default for the original Palmby version. Additionally, David H . Ahl has explicitly released his work to the public.
This is probably done, but if you find a bug please file a PR or Issue.
If you want to enhance, it is public domain, just fork it.
- Two-player (note 3+ players requires actual deck modeling/card-counting)
- Ruleset selection (Basic Computer Games, or Bicycle Cards)
- Track wins-losses when the user opts to play again
- Display probabilities/risks (and logic how this is calculated)
- Emojis for cards
- Support for Bubble Tea
- i18n
- ..maybe use i18n to also toggle between 40 and 80-col, legacy UPPER case or modern Mixed like how some retro micros worked.
- Display David Beker's card-playing robot in the Terminal go-sixel (with attribution and link of course)
- A GUI Ebitengine
- Combine this with other card games into a single app, using subcommands to select games Cobra
- Write as an HTTP API game server (let someone else write a client for it)
- Use goRemi, a prototype for card-playing game
- Acey Ducey, from BASIC Computer Games
- Basic Computer Games 1978 version (PDF)
- Basic Computer Games 1975 version (PDF)
- In-Between: How to Play (Bicycle Cards)
- In-Between: Game Rules
- Updating The Single Most Influential Book of the BASIC Era
- coding-horror/basic-computer-games
- Red dog (card game) (Slightly different game, but shares wiki page with Red Dog)
- Troy Campbell wrote the Go version of Acey Ducey in coding-horror
- David H. Ahl, PUBLIC DOMAIN
- 10 PRINT"LET'S READ BASIC COMPUTER GAMES":GOTO 10
- David H Ahl
- David Beker's Bots
Thanks to the author of BGC, David H Ahl for collecting and documenting this amazing tome of simple (some not so simple) terminal games.
Thanks also to the book's illustrator, David Beker, whose robots attracted the eye of many an eleven year old. BCG was not intended to be a kid's book, but thanks to the robots, it was.