1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! `atomic-movegen` — atomic chess move generation in Rust.
//!
//! This crate implements legal move generation, FEN parsing, and perft for
//! [atomic chess](https://en.wikipedia.org/wiki/Atomic_chess).
//!
//! # Atomic chess rules implemented
//!
//! - **Blast on capture:** capturing (or en passant) destroys all non-pawn
//! pieces in a 3×3 king-move blast zone centered on the capture square,
//! including the capturer itself if it is not a pawn.
//! - **Pawns are blast-immune:** pawns are never removed by a blast.
//! - **COMMONER replaces KING:** pieces move like kings but are pseudo-royal.
//! Losing all COMMONERs means loss. Adjacent COMMONERs (even own) are illegal
//! (extinction pseudo-royal rule).
//! - **No check/mate in the usual sense:** the game ends when a side has no
//! COMMONERs left.
//!
//! # Example
//!
//! ```rust
//! use atomic_movegen::board::Board;
//! use atomic_movegen::perft;
//!
//! let mut board = Board::new();
//! let nodes = perft(&mut board, 3);
//! assert_eq!(nodes, 8902);
//! ```
use crateMoveList;
/// Count the number of legal moves at each node to the given depth (perft).
///
/// This is the standard perft (performance test) function used to verify
/// move-generator correctness against a reference engine.