chess-move-gen

Crates.iochess-move-gen
lib.rschess-move-gen
version0.9.0
created_at2017-03-23 19:27:04.809068+00
updated_at2025-01-01 11:40:34.875735+00
descriptionFast chess move generation library. Uses SIMD for fast sliding piece move generation
homepagehttps://github.com/peterellisjones/rust_move_gen
repositoryhttps://github.com/peterellisjones/rust_move_gen.git
max_upload_size
id9118
size3,062,170
Peter Jones (peterellisjones)

documentation

README

Fast chess move generation library. Uses SIMD for fast sliding piece move generation

Example usage:

use chess_move_gen::*;
let mut list = MoveVec::new();
let position = &Position::from_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QqKk - 0 1").unwrap();
legal_moves::<MoveVec>(position, &mut list);
assert_eq!(list.len(), 20);

Ways to store moves:

MoveVec: Wraps a vector of generated moves, useful if you need to access the actual moves being generated

MoveCounter: Counts moves of each kind (captures, castles, promotions etc). Useful if you are making a perft function or need statistics about moves for a position, but don't care about the actual moves

SortedMoveAdder + SortedMoveHeap: Stores genarated moves in a sorted binary heap, which are efficiently ordered as they are inserted based on a heuristic scoring and piece-square table that you provide. Use this if you want the moves to have a reasonably good initial ordering so moves that are checked first are more likely to lead to eg alpha-beta cutoffs and reduce the search tree size.

Commit count: 0

cargo fmt