packages/library/BlackJackOdin
b

BlackJackOdin

v397ba9blibrary

No description provided.

0 stars0 forksUnknownupdated 1 year ago
Open repo

šŸ‚” Command-Line Blackjack in Odin (WORK IN PROGRESS)

šŸ“ Project Overview

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.


šŸŽÆ Features

  • 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

šŸ› ļø Technologies

  • Language: Odin
  • Platform: Cross-platform (Tested on Windows & Linux)

šŸ“¦ Getting Started

Prerequisites

Run the Game

odin run src

🧠 How It Works

  1. Deck Initialization: Generates a fresh 52-card deck.
  2. Shuffling: Randomly shuffles the deck using rand from Odin's standard library.
  3. Dealing: Both player and dealer receive 2 cards initially.
  4. Player Turn: Choose to Hit or Stand until bust or stand.
  5. Dealer Turn: Dealer plays by rules (hits below 17).
  6. Result: The program determines the winner based on Blackjack rules.

šŸ“ File Structure

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)

🚧 Future Improvements

  • Split and Double Down options
  • Persistent game stats
  • Multiplayer support
  • Betting system

šŸ“„ License

MIT License


Debug Setup

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 .vscode folder at the root of your Odin project
  • copy the launch.json and tasks.json into 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

FAQ

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.

Package Info
Version
v397ba9b
License
Unknown
Author
@jeremychiefgeek
Type
library
Forks
0
Created
1 year ago
Updated
1 year ago
Health
maintained
has releases
has readme
has license
Activity
last 56 weeks