use crate::gen::random::Xoshiro256PlusPlus;
use crate::{CastleRights, Piece, Square};
#[allow(dead_code)]
pub fn generate_unique_u64_keys(seed: [u64; 4]) {
let mut prng: Xoshiro256PlusPlus = Xoshiro256PlusPlus::new(seed);
println!("pub const KEY_PIECE_SQUARE: [[u64; Square::NUM_SQUARES]; Piece::NUM_PIECES] = [");
for _ in 0..Piece::NUM_PIECES {
print!(" [");
for j in 0..Square::NUM_SQUARES {
print!("{}", prng.next_u64());
if j != 63 {
print!(", ");
}
}
println!("],");
}
println!("];");
println!("\npub const KEY_ENPASSANT: [u64; Square::NUM_SQUARES] = [");
print!(" ");
for i in 0..Square::NUM_SQUARES {
print!("{}", prng.next_u64());
if i != 63 {
print!(", ");
}
}
println!("\n];");
println!("\npub const KEY_CASTLE: [u64; CastleRights::NUM_CASTLING_RIGHTS] = [");
print!(" ");
for i in 0..CastleRights::NUM_CASTLING_RIGHTS {
print!("{}", prng.next_u64());
if i != 15 {
print!(", ");
}
}
println!("\n];");
print!("\npub const KEY_SIDE: u64 = {};", prng.next_u64());
}
#[test]
fn generate_zobrist() {
let seed: [u64; 4] = [
0x1a2b3c4d5e6f7,
0x1122334455667788,
0x99aabbccddeeff00,
0x2233445566778899,
];
generate_unique_u64_keys(seed);
}