casino 0.3.0

A casino built right into your terminal
Documentation
# casino

[![status-badge](https://ci.cosmicrose.dev/api/badges/2/status.svg)](https://ci.cosmicrose.dev/repos/2)
![Crates.io Version](https://img.shields.io/crates/v/casino)
[![Crates.io](https://img.shields.io/crates/d/casino)](https://crates.io/crates/casino)

An entire casino built into your terminal.

Bet with fake money and play baccarat, blackjack, slots, roulette, and craps
from the comfort of your shell.

## Install

Install using [`cargo`](https://github.com/rust-lang/cargo):

```sh
cargo install casino
```

## Usage

Run `casino` for a selection of games, or `casino <game>` to start a specific game.
You can run `casino --help` for a list of games and other options.

```console
$ casino blackjack
Your money: $1000.00
> How much will you bet? 100
Betting $100.00
* The dealer issues your cards.
Dealer's hand: 🂠 🃂
Your hand: 🃔 🂺  (14)
> What will you do? Stand
* Hole card revealed!
Dealer's hand: 🂻 🃂  (12)
* The dealer issues themself another card.
Dealer's hand: 🂻 🃂 🃕  (17)
* The hand is finished!
HOUSE WINS! You lose $100.00. You now have $900.00
```

You start with $1000.00, and if you ever hit $0.00, you are gifted another
$1000.00. This balance is persisted to your XDG data directory, along with the
state of the deck of cards you're playing with. You can modify this file if you
want to break my heart and cheat at this innocent little terminal game.

Check your wallet balance with `casino balance`:

```console
$ casino balance
$1000.00
```

You can view your lifetime stats with `casino stats`:

```console
$ casino stats
Most money in the bank.........$1109.00
Times hit bankruptcy..................0

Blackjack
  Hands won.............................1
  Hands lost............................0
  Hands tied............................0
  Total money won.................$100.00
  Total money lost..................$0.00
  Biggest win.....................$100.00
  Biggest loss......................$0.00

Roulette
  Spins won.............................1
  Spins lost............................0
  Total money won.................$100.00
  Total money lost..................$0.00
  Biggest win.....................$100.00
  Biggest loss......................$0.00

Slots
  Total pulls...........................5
  Total money spent................$71.00
  Total money won..................$40.00
  Biggest jackpot..................$40.00
```

Run `casino --help` for full usage instructions and documentation.

## Files

This program creates a few files, and respects the XDG Base Directory
specification so as not to clutter up your home folder.

- `~/.config/casino/config.toml` - general app and game configuration
- `~/.local/share/casino/state.toml` - your current wallet balance and the
  state of the deck
- `~/.local/share/casino/stats.toml` - where statistics are collected for
  `casino stats`

See the [wiki](https://codeberg.org/cosmicrose/casino/wiki/) for configuration docs.

## Maintainer

This project is maintained by [Rosa Richter](https://cosmicrose.dev).
You can get in touch with her on [Matrix](https://matrix.to/#/@cosmicrose:matrix.org).

## Contributing

Questions and [pull requests](https://codeberg.org/cosmicrose/casino/pulls) are
more than welcome. I follow believe bad documentation is a bug, so if anything
is unclear, please [file an
issue](https://codeberg.org/cosmicrose/casino/issues/new)!

Note that this project is released with a [Code of
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to
abide by its terms.

## License

© 2025 Rosa Richter

This program is free software: you can redistribute it and/or modify
it under the terms of the [GNU Affero General Public License](LICENSE.md) as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.