mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
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.
13 lines
312 B
Elixir
13 lines
312 B
Elixir
defmodule Chesstrainer.Endgames.Tablebase.Backend.Lichess do
|
|
@moduledoc """
|
|
The Lichess tablebase API backend (covers up to seven pieces).
|
|
"""
|
|
|
|
@behaviour Chesstrainer.Endgames.Tablebase.Backend
|
|
|
|
alias Chesstrainer.Endgames.Tablebase.Parser
|
|
|
|
@impl true
|
|
def probe(fen), do: Parser.from_fen(fen)
|
|
end
|