mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Route tablebase lookups through a piece-count backend seam (#27)
Add a Backend behaviour, a Lichess implementation, and a Router that picks a backend by piece count: five or fewer to the local slot, six or seven to the remote slot, and eight or more short-circuited as not covered with no network call. Both slots point at Lichess for now; the local Syzygy backend replaces the local slot when it lands. Map :not_covered to the existing 'not covered by the tablebase' message.
This commit is contained in:
@@ -150,5 +150,12 @@ defmodule Chesstrainer.Endgames.TablebaseTest do
|
||||
|
||||
assert {:ok, ^tablebase} = Tablebase.new(fen)
|
||||
end
|
||||
|
||||
test "returns {:error, :not_covered} for a position with more than seven pieces" do
|
||||
fen = "3k4/2n2B2/1KP5/2B2p2/5b1p/7P/8/8 b - - 0 1"
|
||||
TablebaseCache.delete(fen)
|
||||
|
||||
assert Tablebase.new(fen) == {:error, :not_covered}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user