Fix fen loading tests

This commit is contained in:
2025-08-22 14:47:19 -04:00
parent 5ddb359675
commit 2a7948eab4
4 changed files with 51 additions and 70 deletions

View File

@@ -92,6 +92,14 @@ def sq(name):
return f + 8 * r
def popcount(x):
return x.bit_count()
def get_rank_mask(rank):
return sum(1 << (rank*8 + f) for f in range(8))
class ChessFFI:
def __init__(self):
self.lib_path = "./build/libchess.so"
@@ -130,10 +138,6 @@ class ChessFFI:
def attackers_to(self, board, sq, by):
return self._c_attackers_to(board, sq, by)
def popcount(self, x):
return x.bit_count()
def _load_lib(self):