No description
  • Rust 96.6%
  • Nix 3.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-06 21:24:53 -05:00
src chore: add readme 2026-07-06 21:24:12 -05:00
.envrc feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
.gitignore feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
Cargo.lock feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
Cargo.toml feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
devenv.lock feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
devenv.nix feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
devenv.yaml feat(initial): Start repo with cards, decks, evaluator 2026-05-15 21:41:40 -05:00
game_config.txt chore: add readme 2026-07-06 21:24:12 -05:00
README.md chore: update readme 2026-07-06 21:24:53 -05:00

Poker? I barely know her...

A Texas Hold'em poker simulator written in Rust. Deals hole cards and community cards, evaluates the best 5-card hand from 7, and declares a winner.

Usage

cargo run

The simulator reads game_config.txt from the current directory. This file contains two integers on separate lines:

<number of decks>
<number of players>

Example game_config.txt:

1
2

How it works

Each round deals 2 hole cards per player and 5 community cards (flop, turn, river). Each player's best 5-card hand is selected from their 2 hole cards + 5 community cards, then hands are ranked and a winner is declared.

Hand rankings (low → high)

  1. High Card
  2. One Pair
  3. Two Pair
  4. Three of a Kind
  5. Straight
  6. Flush
  7. Full House
  8. Four of a Kind
  9. Straight Flush
  10. Royal Flush

Project structure

src/
├── main.rs        entry point — reads odds.txt, starts game
├── card.rs        Suit/Rank enums, Card type
├── deck.rs        Deck with shuffle and deal
├── evaluator.rs   5-card evaluator and 7-card best-hand selector
└── game.rs        Player, dealing flow, winner determination

Build

Requires Rust (2024 edition).

cargo build
cargo test