add custom chess engine

This commit is contained in:
Josh-Heaps
2026-06-08 13:58:22 -06:00
parent d2ae34f530
commit c3280aa6d3
42 changed files with 3033 additions and 168 deletions
+22
View File
@@ -0,0 +1,22 @@
#include "perft.h"
namespace chess {
uint64_t perft(Position& pos, int depth) {
if (depth == 0) return 1;
MoveList list;
pos.generate_legal(list);
if (depth == 1) return uint64_t(list.size());
uint64_t nodes = 0;
for (Move m : list) {
pos.do_move(m);
nodes += perft(pos, depth - 1);
pos.undo_move(m);
}
return nodes;
}
} // namespace chess