o
odinpkg.dev
packages / app / terminal21

terminal21

32047f6app

A blackjack engine written in Odin, playable in the terminal. Features split, double down, betting system, and save/load.

No license ยท updated 3 days ago

terminal21 ๐Ÿƒ

A blackjack game written in Odin, running in the terminal.

This was a project I felt I needed to do to be able to escape tutorial's hell and start actually learning. I decided to recreate Blackjack because of my kinda sick love for the game and felt it was a good opportunity to get my hands dirty with the language.

The rules follow what I can remember about my trips to Singapore, so double is allowed only on 9, 10 or 11. I didn't make a distinction between hard and soft, please be gentle.

There will probably be bugs, but I think it turned out pretty well.

Requirements

Run

odin run .

Build

odin build . -out:bin/terminal21.exe

How to play

  • You are dealt two cards, the dealer shows one
  • Choose to hit (draw a card) or stay (end your turn)
  • Get closer to 21 than the dealer without going over
  • Dealer hits until 17 or more

What works

  • 6-deck shoe (312 cards) with reshuffle at 25% remaining
  • Fisher-Yates shuffle
  • Hit or stand input loop
  • Bust detection (points > 21)
  • Dealer AI (hits until 17+)
  • Blackjack detection (21 on first two cards)
  • Win / lose / draw resolution
  • Ace as 1 or 11
  • Bettin system
  • Score tracking system
  • Better terminal UI
  • Split hands
  • Double