/go_bcg_01_acey_ducey

Golang version of Creative Computing's Acey Ducey

Primary LanguageGoOtherNOASSERTION

Acey Ducey

License: ODbL

Description

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.

Purpose

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?

Game Logic (Approximate)

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.

Run

go run main.go NOTE: Requires Go v1.20+ (has math/rand with seed auto-set).

Game Review Process

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.

Credits

Bill Palmby of Prairie View, Illinois wrote the original version in BCG.

LICENSE

Public domain, as was default for the original Palmby version. Additionally, David H . Ahl has explicitly released his work to the public.

Contributing

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.

Possible Improvements

  • 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

References

Special Mentions

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.