12 releases

0.5.3 Nov 27, 2023
0.5.2 Jun 7, 2023
0.5.1 Mar 22, 2023
0.4.0 Nov 5, 2022
0.0.2 Sep 27, 2015

#313 in Algorithms

Download history 20/week @ 2024-01-04 26/week @ 2024-01-11 32/week @ 2024-01-18 4/week @ 2024-01-25 55/week @ 2024-02-01 16/week @ 2024-02-08 25/week @ 2024-02-15 49/week @ 2024-02-22 22/week @ 2024-02-29 4/week @ 2024-03-07 9/week @ 2024-03-14 28/week @ 2024-03-21 50/week @ 2024-03-28 20/week @ 2024-04-04 13/week @ 2024-04-11 1/week @ 2024-04-18

86 downloads per month

MIT license

105KB
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–2MB
~38K SLoC