{ 01_hello_board.pas -- the smallest possible SAN Kit program.
  Pascal translation of ../examples/01_hello_board.c.

  Functions demonstrated:
    SANInit()      -- one-time library initialization (call exactly once)
    SANDspBoard()  -- print the current position as an ASCII diagram
    SANFENGen()    -- return the current position as a FEN string

  Every program built on the SAN Kit library must call SANInit()
  before touching any other SAN Kit function. It sets up all the
  global lookup tables, allocates the move-tree storage, and resets
  the board to the normal starting position.

  See sankit.pas's own header comment for why WriteLn is always
  paired with Flush(Output)/FlushCOutput(nil) around a SAN Kit call
  that prints (SANDspBoard, here) -- without it, this program's own
  output and the library's would very likely print out of order.
}

program hello_board;

uses
  SanKit;

begin
  SANInit;

  WriteLn('SAN Kit initialized. Starting position:');
  WriteLn;
  Flush(Output);

  SANDspBoard;
  FlushCOutput(nil);

  WriteLn;
  WriteLn('As FEN: ', SANFENGen);
end.
