Add Zobrist hashing
This commit is contained in:
@@ -27,11 +27,13 @@ pub fn from_fen(fen: &str) -> Result<Game, FenError> {
|
||||
));
|
||||
|
||||
let mailbox = Mailbox::new_from_board(&board);
|
||||
let hash = zobrist_keys().calculate_hash(&board);
|
||||
|
||||
Ok(Game {
|
||||
board,
|
||||
history: History::new(),
|
||||
mailbox,
|
||||
hash,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -132,6 +134,7 @@ use std::collections::HashMap;
|
||||
|
||||
use super::history::History;
|
||||
use super::mailbox::Mailbox;
|
||||
use super::zobrist::zobrist_keys;
|
||||
|
||||
fn en_passant_square(square: &str) -> Result<Option<usize>, FenError> {
|
||||
let mut sqr = square.chars();
|
||||
|
||||
Reference in New Issue
Block a user