A minimalist command-line Blackjack game written in the Odin programming language. This project demonstrates core programming concepts in Odin including I/O handling, control flow, and data structures, while providing a playable and interactive blackjack experience in the terminal.
- Basic Blackjack rules (player vs dealer)
- Full deck of 52 cards, shuffled each game
- Player actions: Hit, Stand
- Dealer logic following standard rules (hits until 17+)
- Clear win/lose/draw outcome messages
- CLI-based UI with minimal dependencies
- Language: Odin
- Platform: Cross-platform (Tested on Windows & Linux)
- Odin compiler (install via: odin-lang.org/docs/install)
- A terminal emulator
odin run src- Deck Initialization: Generates a fresh 52-card deck.
- Shuffling: Randomly shuffles the deck using rand from Odin's standard library.
- Dealing: Both player and dealer receive 2 cards initially.
- Player Turn: Choose to Hit or Stand until bust or stand.
- Dealer Turn: Dealer plays by rules (hits below 17).
- Result: The program determines the winner based on Blackjack rules.
src/
āāā main.odin // Entry point
āāā deck.odin // Deck generation and shuffle
āāā game.odin // Game loop and logic
āāā utils.odin // Helper functions (e.g., card display, input)- Split and Double Down options
- Persistent game stats
- Multiplayer support
- Betting system
MIT License
To setup debugging for Odin programs on Windows with VsCode follow these steps:
- make sure you have the C/C++ extension pack (VsCode extension) installed
- create a
.vscodefolder at the root of your Odin project - copy the
launch.jsonandtasks.jsoninto it - click on the debug tab in VsCode, then click on the debug button at the top (or press F5)
Note: if you want to use a starter template which also sets up a tracking allocator which tracks and reports memory leaks you can use: https://github.com/RednibCoding/Odin-Starter
Q: When I start debugging, I get the following error popup: Configured debug type 'cppvsdbg' is not supported.
A: Make sure you have the C/C++ extension pack installed. If it is already installed, try reinstalling it.