Answers.Body: <p>You can use Lichess. <a href="https://lichess.org/api#tag/Tablebase" rel="nofollow noreferrer">https://lichess.org/api#tag/Tablebase</a>
  Here is an example where I used Lichess table base for my chess engine : <a href="https://github.com/PaulJeFi/ramses-chess/blob/main/tablebase_online.py" rel="nofollow noreferrer">https://github.com/PaulJeFi/ramses-chess/blob/main/tablebase_online.py</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-05T15:50:18.660Z
Answers.LastActivityDate: 2022-07-19T16:20:05.197Z
Answers.LastEditDate: 2022-07-19T16:20:05.197Z
Answers.UserDisplayName: LittleCoder
Body: <p>In textbooks you find diagrams about key squares and similar concepts. For example, white can promote a pawn if white's king can control three particular squares infront of the pawn. I would like to analyze tablebase evaluations of multiple positions to arrive at similar but more complicated conclusions, for example going through all possible positions of King and Queen vs King and Rooks pawn on the seventh rank and show all positions of the white king that win (this is also known already, but you get the idea).</p>
  <p>Which software could be used to query a tablebase in such a way? I would be very glad for any suggestions, thanks a lot!</p>
  
Tags: <endgame><programming><tablebases>
Title: How can I query an endgame tablebase for multiple positions using loops/conditional statements?
ThreadText: # How can I query an endgame tablebase for multiple positions using loops/conditional statements?
  
  (Asked by: username_0 on 2021-09-15)
  
  In textbooks you find diagrams about key squares and similar concepts. For example, white can promote a pawn if white's king can control three particular squares infront of the pawn. I would like to analyze tablebase evaluations of multiple positions to arrive at similar but more complicated conclusions, for example going through all possible positions of King and Queen vs King and Rooks pawn on the seventh rank and show all positions of the white king that win (this is also known already, but you get the idea).
  
  Which software could be used to query a tablebase in such a way? I would be very glad for any suggestions, thanks a lot!
  
  **Tags:** endgame, programming, tablebases
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-07-05. Score: 2
  
  You can use Lichess. <https://lichess.org/api#tag/Tablebase>
  Here is an example where I used Lichess table base for my chess engine : <https://github.com/PaulJeFi/ramses-chess/blob/main/tablebase_online.py>
  
  
  ---
  
  