Crate nimlib

source ·
Expand description

githubcrates-iodocs-rs

NimLib is a Rust library for Nim games: calculate nimbers and possible moves

NimLib is work-in-progress at the moment.
Features such as Poker-Nim (coin pools) are not yet implemented.

Modules

Code for handling moves.
This module contains code for handling moves in Nim games, such as calculating the resulting position after a move is applied, determining if a move is valid, and generating all possible moves for a given position.
The inner workings of the nimber calculation algorithm.

Structs

A Nim game
A rule for a Nim game.
This struct specifies a set of possible moves for a player.
A nimber.
Simply wraps a u64.
A move which places coins onto a stack from the player’s pool
Represents a stack of coins; specifically its height.
Simply wraps a u64.
A move which takes coins from a stack

Enums

A Nim move, generally represented, not connected to a position, or a specific game.
Represents a possible split of a stack into two non-empty stacks in a NimAction::Take move
Specifies if a player may/must split a stack into two non-empty stacks after taking coins
Specifies the number of coins that can be taken from a stack in a single move according to a rule.