13 releases

new 0.5.4 Feb 19, 2025
0.5.3 Nov 27, 2023
0.5.2 Jun 7, 2023
0.5.1 Mar 22, 2023
0.0.2 Sep 27, 2015

#664 in Machine learning

Download history 12/week @ 2024-12-10 1/week @ 2024-12-17 26/week @ 2025-01-28 2/week @ 2025-02-04 305/week @ 2025-02-11

333 downloads per month

MIT license

110KB
2.5K SLoC

minimax-rs - Generic implementations of Minimax in Rust.

Build Status Crates.io Documentation

About

This library provides interfaces that describe:

  1. the rules for two-player, perfect-knowledge games;
  2. methods of evaluating particular game states for a player; and
  3. strategies for choosing moves for a player.

This crate implements multiple different strategies, so that any combination of custom evaluators and strategies can be tested against each other. These include single- and multi-threaded algorithms using alpha-beta pruning, iterative deepening, and transposition tables. There is also a basic implementation of multi-threaded Monte Carlo Tree Search, which does not require writing an evaluator.

Example

The ttt and connect4 modules contain implementations of Tic-Tac-Toe and Connect Four, demonstrating how to use the game and evaluation interfaces. test shows how to use strategies.

Dependencies

~0.3–2.2MB
~41K SLoC