2 releases
Uses new Rust 2024
| new 0.1.1 | Jan 16, 2026 |
|---|---|
| 0.1.0 | Jan 16, 2026 |
#9 in #casino
72KB
1.5K
SLoC
bjrs
A blackjack game engine with optional no_std support.
Features
- Full round flow: betting, player actions, insurance, dealer play, showdown
- Configurable rules via
GameOptions - Deterministic RNG seeded at game creation
stdby default,no_std + allocsupported (enablealloc)
Usage
use bjrs::{Game, GameOptions};
let options = GameOptions::default();
let game = Game::new(options, 42);
let player_id = game.join(1_000);
game.start_betting();
game.bet(player_id, 50).unwrap();
game.deal().unwrap();
// Player actions, dealer play, and showdown omitted here.
See examples/cli_blackjack.rs for a complete playable CLI example.
no_std
By default this crate uses std. To opt into no_std:
[dependencies]
bjrs = { version = "0.1", default-features = false, features = ["alloc"] }
License
Licensed under either of:
- Apache License, Version 2.0
- MIT license
Dependencies
~1.1–2.3MB
~40K SLoC