<?xml version="1.0" standalone="no"?>
<!--<!DOCTYPE article "-//OASIS//DTD Simplified DocBook XML V4.1.2//EN"
                  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-->
<article>
 <articleinfo>
  <title>CXBoard Protocol Definition</title>
  <author>
   <firstname>Noah</firstname><surname>Roberts</surname>
  </author>
  <edition>1st</edition>
 </articleinfo>

 <abstract>
  <para>
This article documents the CXBoard protocol, version 1, designed for communication between
Chinese Chess engines and interfaces or converters.
  </para>
 </abstract>

 <section><title>Introduction</title>
  <para>
The XBoard (WinBoard for MS lackeys) has been very successful in the computer Chess
community.  Separating the interface from the engine has allowed developers to take differing
directions in development goals yet still have interoperatable components.  Users may
interact with engines through a variety of interfaces in order to play against them, use them
to analyze games, or pit them against each other.  Interface authors can devote themselves to
designing a pleasant and complete interface without having to worry about AI issues, and
engine authors can write their engines knowing that they will be useful to users in the
manner they wish to use them.
  </para>
  <para>
Recently a
competitor to XBoard was designed called the Universal Chess Interface (UCI).  This new protocol
took a very different direction than XBoard yet still stayed relatively similar.  In UCI the
interface is in charge of everything and the engine's only job is to think about positions.
The UCI protocol also adds some very useful commands sets, such as its option set, that
XBoard is not yet capable of.  One of the major strengths of UCI over XBoard is that UCI was
designed as a communication protocol while XBoard is an ad-hoc protocol created origionally
to communicate with a single engine (GNUChess).
  </para>
  <para>
Neither of these protocols is capable of communicating all of the needs for Chinese Chess as
they where designed for Western Chess and it's variants only.  A new protocol is necissary
to adiquately replicate the XBoard/Engine system created by XBoard/GNUChess and then later
by UCI.  This document describes just such a protocol.
  </para>
  <para>
There are weaknesses and strengths in both XBoard and UCI, and since we are creating
something totally new we have decided to use the best parts of each.  In CXBoard you may
run the engine in forced mode only like UCI, or you may choose to let the engine be in more
control like XBoard.  We have adopted the UCI option command set as well as synchronization
and a few other things, added commands necissary for the engine to have control from XBoard,
and added a small set of extra commands that seemed useful and/or necissary.
  </para>
 </section>

 <section><title>Permission to Use</title>
  <para>
   Feel free to use this protocol in your own engines or interface.  I only ask that if you
call your engine or interface cxboard compliant that you be sure that it is.  Contact
the authors though the sourceforge website at http://xiangqi-engine.sourceforge.net to
request additions or alterations to the protocol before altering it yourself.  If you need
alterations that are not being included in the protocol you may create derivative works but
you must call them by a different name.
  </para>
  <para>
Please keep in mind that this protocol is a copyrighted work.  We are asking very little from
users; only what is needed to be sure compatability is retained.  It is a sad world indeed
if these requirements cannot be met.
  </para>
 </section>

 <section><title>Preliminaries</title>
  <para>
All interfaces and engines must meet the following requirements:
  </para>
  <itemizedlist>
   <listitem>
    <para>
All command strings end in '\n'.
    </para>
   </listitem>
   <listitem>
    <para>
Processing will be done through standard input and output handles and components must
always be able to process input.
    </para>
   </listitem>
   <listitem>
    <para>
The interface is in control of the opening book unless the "OwnBook" option is turned on.
    </para>
   </listitem>
   <listitem>
    <para>
The engine must never exit if it recieves a version higher than what it knows.  Future
versions of this protocol will be backwards compatable.
    </para>
   </listitem>
   <listitem>
    <para>
All moves are sent and processed in "long algebraic notation".  The board is labeled from
left to right with a-i and from bottom to top with 0-9 from red's perspective.  Moves are
sent with the origin followed by destination as one 4 character word.
    </para>
    <para>
     Examples: h0g2, e0e1, h2e2
    </para>
   </listitem>
  </itemizedlist>
 </section>

 <section><title>Description of CFEN</title>
  <para>
Positions are described in a modified version of Forsyth-Edwards Notation dubbed CFEN.  This
new format simply removes the fields "castling availability", "en-passant square", and
"half-move clock".  The position description segment contains one extra file and rank.
  </para>
  <para>The following characters are used to represent pieces:</para>
  <itemizedlist>
   <listitem>
    <para>Pp - Pawn or Soldier</para>
   </listitem>
   <listitem>
    <para>Cc - Canon</para>
   </listitem>
   <listitem>
    <para>Rr - Rook or Cart</para>
   </listitem>
   <listitem>
    <para>Hh - Horse or Knight</para>
   </listitem>
   <listitem>
    <para>Ee - Elephant</para>
   </listitem>
   <listitem>
    <para>Aa - Advisor or Guard</para>
   </listitem>
   <listitem>
    <para>Kk - King or General</para>
   </listitem>
  </itemizedlist>
  <para>Example: rheakaehr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RHEAKAEHR r 1</para>
 </section>

 <section><title>Interface to Engine</title>
  <variablelist>
   <varlistentry><term>cxboard VERSION</term>
    <listitem>
     <para>
This command is sent immediately upon starting the engine and opening a communication port.
The version is the highest version number of the protocol that the GUI understands.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>force</term>
    <listitem>
     <para>
Enter forced mode.
     </para>
     <para>
In forced mode the engine will not make any moves without being told to,
will check all moves for legality, will not ponder until told to, will stop and ignore its
own internal clocks, will begin responding to the &quot;go&quot; command.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>go</term>
    <listitem>
     <para>
Only valid in force mode.  Start calculating on the current position.
     </para>
     <para>
There are a number of commands that can follow this command, all will be sent on the same
string.  If a command is not sent its value should be assumed as to not influence the search.
     </para>
     <variablelist>
      <varlistentry><term>* searchmoves &lt;move1&gt; ... &lt;movei&gt;</term>
       <listitem>
        <para>
Restrict the search to only these moves.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* ponder</term>
       <listitem>
        <para>
Begin searching in ponder mode.  Switch to standard search mode upon recieving the next
move command.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* rtime &lt;X&gt;</term>
       <listitem>
        <para>
Red has X msec left on the clock.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* btime &lt;X&gt;</term>
       <listitem>
        <para>
Black has X msec left on the clock.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* mtime &lt;X&gt;</term>
       <listitem>
        <para>
Moves must be limited to X msec in time.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* otime &lt;X&gt;</term>
       <listitem>
        <para>
The is X msec on the overtime clock.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* movestogo &lt;X&gt;</term>
       <listitem>
        <para>
There are X moves left until the next time control.  If you don't get this then clocks are
game clocks.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* depth &lt;X&gt;</term>
       <listitem>
        <para>
Limit the search to X ply not including quescence.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* nodes &lt;X&gt;</term>
       <listitem>
        <para>
Limit the search to X nodes.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* mate &lt;X&gt;</term>
       <listitem>
        <para>
Search for a mate in X moves
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* movetime &lt;X&gt;</term>
       <listitem>
        <para>
Search for exactly X mseconds
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>* infinite</term>
       <listitem>
        <para>
Search until the "stop" command.  Do not exit the search without being told to in this mode.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>
   <varlistentry><term>playcurrent</term>
    <listitem>
     <para>
Leave force mode if in it, set the engine to play the color that is on move, associate the
engine's clock with the color that is on move, associate the opponent's clock with the color
not on move, start the engine's clock, start thinking and eventually make a move.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>playother</term>
    <listitem>
     <para>
Leave force mode if in it, set the engine to play the color not on move, associate the
engine's clock with the color not on move, associate the oppenent's clock with the clock on
move, start the opponent's clock, if pondering is available begin pondering, when a move is
recieved begin thinking and eventually make a move.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>move MOVE</term>
    <listitem>
     <para>
Check the supplied move for legality and make the move on the internal board if legal to do
so.  Stop the clock on move, begin the clock not on move, switch color to move.  If new color
to move in the engine's color, and not in force mode, begin thinking and eventually make a
move.  If new color is opponent's color and not in force mode then take move back and reply
with error (you can check this before making the move).
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>?</term>
    <listitem>
     <para>
Stop thinking and make a move immediately.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>stop</term>
    <listitem>
     <para>
Only valid in force mode.  Stop calculating as soon as possible, reply with a bestmove
command.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>isready</term>
    <listitem>
     <para>
This is used to synchronize the engine and GUI.  When the GUI has sent a series of commands
that may take some time to complete this command can be used to wait for the engine to be
ready again or to ping the engine to see if it is still living.  This command must always
be answered with &quot;readyok&quot;.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>setoption name &lt;id&gt; [value &lt;X&gt;]</term>
    <listitem>
     <para>
This command is sent to the engine when the user wishes to change its internal parameters.
For the &quot;Button&quot; type no value is needed.  One string will be sent for each
parameter and this will only be sent when the engine is waiting.  The name of the option in
&lt;id&gt; must not be case sensitive.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>position [cfen &lt;fenstring&gt; | startpos ] moves &lt;move1&gt; ... &lt;movei&gt;</term>
    <listitem>
     <para>
Set up the position described and make the moves on the internal chess board.  If the game
was played from the starting position the string &quot;startpos&quot; will be sent.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>debug [ on | off ]</term>
    <listitem>
     <para>
Switch the debug mode on/off in the engine.  In debug mode the engine should send additional
infos to the GUI.  This mode should be switched off by default and this command can be sent
at any time.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>draw</term>
    <listitem>
     <para>
The engine's opponent offers the engine a draw. To accept the draw, send "offer draw". To decline, ignore the offer (that is, send nothing).  Continue playing until the interface tells you the game is over. See also "offer draw" below.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>result RESULT {COMMENT}</term>
    <listitem>
     <para>
       After the end of each game, the interface must send the engine this
command.  RESULT is either 1-0, 0-1, 1/2-1/2, or * to indicate if the game
was won by red, by black, a draw, or not finished.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>hint</term>
    <listitem>
     <para>

	request a hint from the engine, the engine should respond with
"info hint xxxx" where xxxx is the recommended move, or it should ignore the
command if there is no hint to make or if the command is not implemented.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>undo</term>
    <listitem>
     <para>
 back up one move.  The interface must always put the engine in force mode before sending
this command.  It is recommended that this command be denied if not in force mode.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>remove</term>
    <listitem>
     <para>
retract the last move made by the color on move.  In other words undo the last 2 moves, one
for each player.  This command can be used in any mode.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>name</term>
    <listitem>
     <para>
Tell engine it's opponent's name.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>computer</term>
    <listitem>
     <para>
Tells the engine that it is playing another engine and not a human.  Engines will often
drop expensive strategic evaluation in favor of speed and depth when playing another engine.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>pause</term><term>resume</term>
    <listitem>
     <para>
  in pause mode the engine must not think, ponder, or otherwise consume significant CPU time.
The current thinking or pondering is is suspended and both player's clocks are stopped.
The only command that can be sent in this state is the resume command; the engine resumes
in the same state it was in when it entered pause mode.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>score</term>
    <listitem>
     <para>
The engine should reply with an info command representing it's score of the current
position.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>clock GAMECLOCK MOVECLOCK OVERTIME</term>
    <listitem>
     <para>
Set the clocks of both players.  GAMECLOCK is the total time available for the game for each
side, MOVECLOCK is the maximum amount of time that can be used for a single move, and
OVERTIME is the amount of time available to make each move after the GAMECLOCK has run out.
Times are in minutes or minutes and seconds.
     </para>
     <para>Examples: "clock 60 1 :30" - 5 minutes to play, 1 minute to move, 30 second overtime</para>
    </listitem>
   </varlistentry>
  </variablelist>
 </section>

 <section><title>Engine to Interface</title>
  <variablelist>
   <varlistentry><term>id</term>
    <listitem>
     <variablelist>
      <varlistentry><term>* name &lt;X&gt;</term>
      <listitem>
       <para>
This must be sent after recieving the &quot;cxboard&quot; command to identify the engine.  Example:
"id name tsito 2.0.0"
       </para>
      </listitem>
      </varlistentry>
      <varlistentry><term>* author &lt;X&gt;</term>
      <listitem>
       <para>
This must be sent after recieving the &quot;cxboard&quot;.  Example:
"id author Noah Roberts"
       </para>
      </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>
   <varlistentry><term>cxboardok</term>
    <listitem>
     <para>
Must be sent after the it and optional option to tell the GUI that the engine has sent all
info and is ready in cxboard mode.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>readyok</term>
    <listitem>
     <para>
This must be sent in reply to isready when it has finished processing all input and is ready
to accept new commands.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>bestmove &lt;move&gt;</term>
    <listitem>
     <para>
Used in force mode when finished with a go command.  The engine has not made the move and
will not enter ponder mode until requested.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>copyprotection</term>
    <listitem>
     <para>
Used to tell the interface that copyprotection is being checked.  After the cxboardok command
the engine can say &quot;copyprotection checking&quot;.  When it has finished checking the
engin must send &quot;copyprotection ok&quot; or &quot;copyprotection error&quot;.  If there
is an error the engine should respond to every command but quit with an Error reply and not quit until
requested.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>info</term>
    <listitem>
     <para>
Send info to interface.  This command should be sent any time something changes or in
responce to a request for information (ie. hint).
     </para>
      <variablelist>
       <varlistentry><term>* depth &lt;X&gt;</term>
        <listitem>
         <para>
search depth in plies.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* seldepth &lt;X&gt;</term>
        <listitem>
         <para>
selective search depth in plies; must be accompanied by a depth in same string.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* time &lt;X&gt;</term>
        <listitem>
         <para>
time speant searching in miliseconds.  should be sent with pv.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* pv &lt;move1&gt; ... &lt;movei&gt;</term>
        <listitem>
         <para>
the best line found
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* multipv &lt;num&gt;</term>
        <listitem>
         <para>
for multi pv mode.  send with pv to represent the order of pvs.  best line is multipv 1.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* score &lt;X&gt;</term>
        <listitem>
         <para>
	  <variablelist>
	   <varlistentry><term>* cp &lt;X&gt;</term>
	    <listitem><para>
score from the engine's perspective in centipawns
	    </para></listitem>
	   </varlistentry>
	   <varlistentry><term>* mate &lt;X&gt;</term>
	    <listitem><para>
mate in x moves
	    </para></listitem>
	   </varlistentry>
	   <varlistentry><term>* lowerbound</term>
	    <listitem><para>
score is a lowerbound
	    </para></listitem>
	   </varlistentry>
	   <varlistentry><term>* upperbound</term>
	    <listitem><para>
score is an upperbound
	    </para></listitem>
	   </varlistentry>
	  </variablelist>
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* currmove &lt;move&gt;</term>
        <listitem>
         <para>
currently searching move.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* currmovenumber &lt;X&gt;</term>
        <listitem>
         <para>
currently searching move number x.  The first move is 1 not 0.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* hashfull &lt;X&gt;</term>
        <listitem>
         <para>
The hash is x permill full, the engine should send this regularly.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* nps &lt;X&gt;</term>
        <listitem>
         <para>
x nodes per second searched, the engine should send this regularly.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* tbhits &lt;X&gt;</term>
        <listitem>
         <para>
x positions where found in the endgame tablebases.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* cpuload &lt;X&gt;</term>
        <listitem>
         <para>
the cpu usage of the engine is x permill.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* string &lt;X&gt;</term>
        <listitem>
         <para>
any string to be displayed.  all following characters on the line will be considered part of
the string.
         </para>
        </listitem>
       </varlistentry>
       <varlistentry><term>* hint &lt;move&gt;</term>
        <listitem>
         <para>
the engine recommends move as the next best.  Sent in responce to hint command.
         </para>
        </listitem>
       </varlistentry>
      </variablelist>
    </listitem>
   </varlistentry>
   <varlistentry><term>option</term>
    <listitem>
     <para>
This command tells the GUI about parameters that can be set by the user.  These should be
sent after the id command sequence and before cxboardok.  The GUI should use this information
to build a settings dialog.  The GUI will use the setoption command to alter these options
on the user's behalf.  One string will be sent for each parameter.
     </para>
     <variablelist>
      <varlistentry><term>name &lt;id&gt;</term>
       <listitem>
        <para>
The option has the name id.  This can be sent in any language.  Certain options have fixed
value for id, which means that the semantics for the option are fixed:
        </para>
        <variablelist>
	 <varlistentry><term>id = Hash, type is spin</term>
	  <listitem>
	   <para>
Amount of memory in MB used for trasposition table.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>id = Ponder, type is check</term>
	  <listitem>
	   <para>
the engine is able to ponder.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>id = OwnBook, type is check</term>
	  <listitem>
	   <para>
The engine is in charge of its own opening book.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>id = MultiPV, type is spin</term>
	  <listitem>
	   <para>
the engine supports multiple best line mode.  default is 1
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>id = Variant, type is combo</term>
	  <listitem>
	   <para>
The engine supports the listed variants.  Default is XiangQi.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </listitem>
      </varlistentry>
      <varlistentry><term>type</term>
       <listitem>
        <para>
        </para>
	<variablelist>
	 <varlistentry><term>check</term>
	  <listitem>
	   <para>
A checkbox that can be either true or false.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>spin</term>
	  <listitem>
	   <para>
a spin wheel that can be an integer in a certain range
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>combo</term>
	  <listitem>
	   <para>
a combo box that can have different predefined strings as a value
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>button</term>
	  <listitem>
	   <para>
a button that can be pressed to send the engine a command.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry><term>string</term>
	  <listitem>
	   <para>
a text field that has a string as a value.  an empty string has the value &quot;&lt;empty&gt;&quot;
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </listitem>
      </varlistentry>
      <varlistentry><term>default</term>
       <listitem>
        <para>
The default value of this parameter
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>min</term>
       <listitem>
        <para>
the minimum of this parameter
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>max</term>
       <listitem>
        <para>
the maximum of this parameter
        </para>
       </listitem>
      </varlistentry>
      <varlistentry><term>var</term>
       <listitem>
        <para>
a predefined value of this parameter
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
     <para>
      Examples:
     </para>
     <para>
option name OwnBook type check default true
     </para>
     <para>
option name Hash type spin default 32 min 0 max 1024
     </para>
     <para>
option name Search type combo default AlphaBeta var MTD var AlphaBeta var NegaScout
     </para>
     <para>
option name OpeningBookPath type string default /usr/share/tsito/book.dat
     </para>
     <para>
option name Clear Hash type button
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>Illegal move[ (&lt;reason&gt;)]: &lt;move&gt;</term>
    <listitem>
     <para>
The attempted move is illegal given the current position.  The engine may optionally specify
a reason.  Examples: &quot;Illegal move: e2e3&quot;, &quot;"Illegal move (in check): e2f2"
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>Error (&lt;errortype&gt;): &lt;command&gt;</term>
    <listitem>
     <para>
The given command has generated the errortype error.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>move &lt;m&gt;</term>
    <listitem>
     <para>
The engine is making the move m.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>result RESULT {COMMENT}</term>
    <listitem>
     <para>
The engine has detected an end to the game and is claiming a win, loss, or draw.  As far as
the engine is concerned the game has finished and will process no more moves until a new
position is provided.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>resign</term>
    <listitem>
     <para>
The engine is resigning.  As far as the engine is concerned the game is finished and will
process no more moves until a new position is provided.  The engine may use the result
command instead of this one.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>offerdraw</term>
    <listitem>
     <para>
The engine wants to claim a draw.  The offer is considered valid until two moves are made.
The game is still on until the engine recieves a result command.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>telluser MESSAGE</term>
    <listitem>
     <para>
Relay MESSAGE to user.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>askuser RESPTAG MESSAGE</term>
    <listitem>
     <para>
Ask user a question.  Interface responds with RESPTAG ANSWER.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>tellopponent MESSAGE</term>
    <listitem>
     <para>
Relay MESSAGE to teh opponent only
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>tellothers MESSAGE</term>
    <listitem>
     <para>
Relay MESSAGE to everyone but the opponent.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry><term>tellall MESSAGE</term>
    <listitem>
     <para>
Relay MESSAGE to everyone.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </section>

 <section><title>Examples</title>
  <section><title>Play mode</title>
   <programlisting>
// GUI start engine
cxboard 1

// Engine identifies itself
id name tsito 2.0
id author Noah Roberts

// Engine tells GUI about some options
option name Null Move type check default true
option name Hash type spin default 32 min 0 max 256
option name Search type combo default MTD var MTD var NegaScout var AlphaBeta

// Engine is done
cxboardok

// Gui sets some options
setoption name Null Move value false
setoption name Hash value 128
setoption name Search value NegaScout

// Wait for engine to do the above
isready

// engine finishes
readyok

// itialize board...
position startpos

// User moves..
move h2e2

// Engine thinks...
info depth 1
info score cp 45 depth 1 nodes 24 time 9 pv b7b0
info depth 2
info score cp 0 depth 2 nodes 130 time 23 pv h9g7 h0g2
// and so on...

// engine replies
move h9g7

// User quits
quit
   </programlisting>
  </section>
  <section><title>Forced mode</title>

   <programlisting>
// GUI start engine
cxboard 1

// Engine identifies itself
id name tsito 2.0
id author Noah Roberts

// Engine tells GUI about some options
option name Null Move type check default true
option name Hash type spin default 32 min 0 max 256
option name Search type combo default MTD var MTD var NegaScout var AlphaBeta

// Engine is done
cxboardok

// Gui sets some options
setoption name Null Move value false
setoption name Hash value 128
setoption name Search value NegaScout

// Wait for engine to do the above
isready

// engine finishes
readyok

// itialize board...
position startpos

// enter force mode...
force

// User moves..
move h2e2

go infinite
// Engine thinks...
info depth 1
info score cp 45 depth 1 nodes 24 time 9 pv b7b0
info depth 2
info score cp 0 depth 2 nodes 130 time 23 pv h9g7 h0g2
// and so on...

// user requests an end...
stop
// engine replies
bestmove h9g7

// Gui decides on something else
move h7h0

// User quits
quit
   </programlisting>
  </section>
 </section>

</article>