/* 10_epd.c -- Extended Position Description (EPD) output.
 *
 * Functions demonstrated:
 *   SANEPDGenBasicCurrent() -- EPD string for the current position
 *   SANEPDGenBasic()        -- EPD string for an arbitrary board,
 *                              active color, castling rights, and
 *                              en passant square, without touching
 *                              the current game state
 *
 * EPD is like FEN but drops the halfmove clock and fullmove number
 * (the two fields that don't describe the position itself), and
 * allows optional trailing "operations" fields that this basic
 * generator does not add. It is commonly used for one-line-per-
 * position test suites.
 */

#include "_common.h"

#include "sanint.h"
#include "sanepd.h"
#include "sanfen.h"

int
main (void)
{
  SANInit ();

  printf ("Current position:\n");
  printf ("  FEN: %s\n", SANFENGen ());
  printf ("  EPD: %s\n", SANEPDGenBasicCurrent ());

  /* SANEPDGenBasic() takes an explicit board/color/castling/en
     passant, so it can describe a position other than the live
     "current" one, e.g. one built by a caller for a test suite */
  printf ("\nSame data, generated explicitly via SANEPDGenBasic():\n");
  printf ("  EPD: %s\n",
          SANEPDGenBasic (&gb, curr_e.e_actc, curr_e.e_cast,
                           curr_e.e_epsq));

  return (0);
}
