#poker #poker-cards #regret-minimization #cfr

bin+lib little-sorry

Library to help with coding regret minimization

7 releases (2 stable)

Uses new Rust 2024

1.1.0 Mar 28, 2025
1.0.0 Mar 6, 2025
0.5.0 Nov 30, 2024
0.4.1 Jun 28, 2024
0.1.0 Nov 27, 2019

#229 in Games

Download history 219/week @ 2025-08-06 97/week @ 2025-08-13 4/week @ 2025-08-20 27/week @ 2025-08-27 1/week @ 2025-09-03 3/week @ 2025-09-10 4/week @ 2025-09-17 31/week @ 2025-09-24 19/week @ 2025-10-01 10/week @ 2025-10-08 25/week @ 2025-10-15 26/week @ 2025-10-22 14/week @ 2025-11-05 13/week @ 2025-11-12 41/week @ 2025-11-19

73 downloads per month
Used in rs_poker

Apache-2.0

16KB
213 lines

Little Sorry

A Rust library for exploring regret minimization algorithms, with a focus on game theory applications.

Features

  • Regret matching implementation
  • Rock Paper Scissors (RPS) example game
  • Highly performant using ndarray for numerical operations
  • Thread-safe with no unsafe code (except for carefully bounded enum conversions)

Getting Started

Add this to your Cargo.toml:

[dependencies]
little-sorry = "1.0.0"

How It Works

The library implements regret minimization algorithms, which are used in game theory to find optimal strategies in imperfect-information games. The core algorithm tracks:

  1. Action probabilities for each possible move
  2. Cumulative regret for not taking alternative actions
  3. Strategy updates based on regret matching

The RPS example demonstrates these concepts in a simple zero-sum game setting.

Building and Testing

# Run all tests
cargo test

# Run benchmarks
cargo bench

# Build in release mode
cargo build --release

License

Licensed under the Apache License, Version 2.0.

Dependencies

~3.5MB
~68K SLoC