NAME

     wischk - plays the game of checkers (draughts)


SYNOPSIS

     wischk [-i] [-l] [-nohc] [-noj] [-fCONFIG] [-cPARMS] think
     wischk [-noj] [-fCONFIG] -show


DESCRIPTION

     wischk plays checkers, either against  a  human  or  against
     another  program.   By  default,  when wischk is run it will
     attempt to play against another program, and  will  take  no
     longer than think seconds to make its move.



OPTIONS

     -i           Play against a human interactively.

     -l           Instead of thinking for  think  seconds  before
                 making a move, search the game tree exhaustively
                 think moves ahead.

     -nohc        By default, wischk uses a simple heuristic con-
                 tinuation  enhancement.   A position will not be
                 statically evaluated until  neither  player  can
                 jump (if the -l option is used, then wischk will
                 search  think  moves  ahead  exhaustively,   and
                 search  deeper on selected branches according to
                 the heuristic).  This option turns off heuristic
                 continuation.

     -noj         In the most common rules of  checkers,  players
                 must  jump when they have the opportunity.  This
                 option turns off  that  rule,  and  makes  jumps
                 optional.

     -fCONFIG     When wischk is playing against another program,
                 the  two programs take turns making moves, pass-
                 ing the resulting board configurations in a file
                 named   by  default  checkers.cfg.   Using  this
                 option, wischk will use the  file  named  CONFIG
                 instead.   If  the  -i option is also used, then
                 CONFIG will contain the board  configuration  of
                 the initial board to use.

     -cPARMS      wischk uses 12 different numeric parameters  in
                 evaluating  a  board position.  Each value gives
                 either a bonus or penalty of some  magnitude  to
                 different  situations  in  a  position.  If this
                 option is used, wischk will use  the  parameters
                 in  the file PARMS instead of the default static
                 evaluation    parameters.     See    the    file
                 defaults.prm  for  an example of the format of a
                 parameter file.

     -show        Ignore options other than -f and -noj;  display
                 a list of possible moves for each player for the
                 given board position, then quit.



INTERACTIVE PLAY

     When playing against a human, wischk uses  a  simple  alpha-
     numeric  board  display.   The user will be prompted for the
     color she wishes to play, and  the  user  will  always  move
     first.   Moves are entered in the notation "c3d4", where the
     first letter-number pair indicates the origin square and the
     second  letter-number pair indicates the destination square.
     If the move is a  jump,  the  opponent's  piece(s)  will  be
     removed.   Multiple jumps are indicated using the same nota-
     tion, e.g. "c3e5g7h5".

     Other commands that can be entered at the prompt are

     help        Display a list of commands and a short  descrip-
                 tion of each.

     quit        Quit the program.

     redraw      Redraw the screen

     time arg    Change the maximum amount of  time  wischk  will
                 spend thinking about a move to arg seconds.

     level arg   Change wischk's maximum look-ahead to arg moves.


     wischk will display various statistics about the game.

     The "maximum depth fully searched" is the  number  of  moves
     ahead  that wischk searched exhaustively, while the "maximum
     depth searched" is the maximum look-ahead  attained  on  any
     branch  of  the  game  tree (usually larger due to heuristic
     continuation).

     The "static value" of a board is  the  value  given  to  the
     current  position  by  wischk's  evaluation  function.   The
     "dynamic value" of a board is the value of the board accord-
     ing  to  the alpha-beta search algorithm with heuristic con-
     tinuation ("(win)" will  be  displayed  if  wischk  sees  an
     imminent  victory,  "(loss)"  if  wischk  sees  an  imminent
     defeat, and "(unknown)" if only one move was possible).



PLAYING AGAINST ANOTHER PROGRAM

     wischk can play against another checkers program  using  the
     "CSCI 490B protocol".  Following this protocol, two programs
     take  turns  being  run,  each   time   reading   the   file
     checkers.cfg,  then  writing  out a new checkers.cfg showing
     the result of its move.  If either program ever  finds  that
     it has won as a result of its move, it deletes checkers.cfg,
     and exits without writing a new one.

     To fully automate a game, the following logic can be used in
     a script or batch file:

          Initialize checkers.cfg
          while ( checkers.cfg exists )
          do
               Run program #1
               if ( checkers.cfg exists ) then
                    Run program #2
               endif
          end while


     The checkers.cfg file has the following format:

          wischk=red dumchk=black
          e b e b e b e b
          b e b e b e b e
          e b e b e b e b
          e e e e e e e e
          e e e e e e e e
          r e r e r e r e
          e r e r e r e r
          r e r e r e r e

     Where the first line gives the names and colors of  the  two
     programs  playing,  and  the  next  eight lines indicate the
     board configuration using the following symbols:

     e   Empty square

     r   Red piece

     R   Red king

     b   Black piece

     B   Black king



EXIT STATUS

     wischk may terminate with the following exit values:

     0       No  errors  occurred   during   execution   and   no
             winning/losing move was made.

     1       wischk has lost the game.

     2       wischk has won the game.

     3       There was  a  syntax  error  on  the  command  line;
             correct usage was displayed.

     4       A static value parameter file was specified with the
              -c option but an error occurred while attempting to
             read from it.

     5       The checkers.cfg file (or other file specified  with
             the -f option) could not be opened.

     6       The checkers.cfg file (or other file specified  with
             the -f option) was not in the correct format.

     7       An error occurred while trying to create a new board
             configuration file.



FILES

     checkers.cfg    Used to pass board position between two pro-
                     grams playing against each other.

     defaults.prm    Sample  file  containing  static  evaluation
                     parameters.



BUGS

     Although it uses a  rather  conservative  algorithm,  wischk
     will occasionally spend more time thinking about a move than
     it should.

     wischk seems strangely weak during the  endgame  (especially
     when  played  against  itself); usually it plays well enough
     until then to do alright.

     No check is made for draws due to repeated moves.

     Heuristic continuation doesn't  quite  work  as  advertised:
     continuation  of  search  occurs only about half as often as
     it's supposed to.  The problem is  that  fixing  this  would
     cause wischk to go over the time limit more often.



AUTHOR

     John Wiseman

     wiseman@neodesic.com
     http://nd1.neodesic.com/


John Wiseman / wiseman@neodesic.com