title: Recommended data format for describing the rules of chess
body: <p>I'm going to be writing a chess server and one or more clients for chess and I want to describe the rules of chess (e.g. allowable moves based on game state, rules for when a game is complete) in a programming language independant way. This is a bit tricky since some of the chess rules (e.g. King Castling, en passent, draws based on 3 or more repeated moves) are based not only on the board layout but also on the history of moves.</p>
  
  <p>I would prefer the format to be:</p>
  
  <ul>
  <li>textual</li>
  <li>human readable</li>
  <li>based on a standard (e.g. YAML, XML)</li>
  <li>easily parsable in a variety of languages</li>
  </ul>
  
  <p>But I am willing to sacrifice any of these for a suitable solution.</p>
  
  <p>My main question is: How can I build algorithms of such a complexity that operate on such complex state from a data format?</p>
  
  <p>A followup queston is: Can you provide an example of a similar problem solved in a similar manner that can act as a starting point?</p>
  
  <p><strong>Edit:</strong> In response to a request for clarity -- consider that I will have a server written in Python, one client written in C# and another client written in Java. I would like to avoid specifying the rules (e.g. for allowable piece movement, circumstances for check, etc.) in each place. I would prefer to specify these rules once in a language independant manner.</p>