Computer Chess Club Archives


Search

Terms

Messages

Subject: pseudo book for Arena

Author: David Dahlem

Date: 14:50:34 07/24/02


This little batch routine will automatically act as a simple random book for
Arena. It will randomly select from 99 opening lines from a pgn file. This pgn
must have at least 99 opening lines. I wanted more but didn't know how to
generate random numbers that large. Of course, you can put any openings in the
pgn file that you like. I use Match.pgn which includes the opening lines from
NunnTest 1 and 2, the Noomen Select C opening lines, a few gambit lines, and
some other fairly equal lines i put in to total 99 opening lines. I would be
glad to send this pgn to anyone who wants it. The batch file will only have to
be edited once, to change to path to your Arena.exe and your pgn file. I didn't
know how to include the Fischer clock, and X moves in X minutes time control, so
only Game in X minutes is used.

===================[START OF CODE]===================================
  @echo off
  echo.
  echo                                - ARENA MATCH -
  echo.
  rem INPUT.BAT
  echo First Engine ?
  fc con nul /lb1 /n | time | find "    1:  "> setinput.bat
  echo @echo off> enter.bat
  echo set input!=%%4>> enter.bat
  call setinput
  del setinput.bat
  del enter.bat

  echo Second Engine ?
  fc con nul /lb1 /n | time | find "    1:  "> setinput.bat
  echo @echo off> enter.bat
  echo set input_=%%4>> enter.bat
  call setinput
  del setinput.bat
  del enter.bat

  echo.
  echo TIME CONTROL
  echo Game in X Minutes only.
  echo Minutes:Seconds ?     (Example 05:00)
  fc con nul /lb1 /n | time | find "    1:  "> setinput.bat
  echo @echo off> enter.bat
  echo set input&=%%4>> enter.bat
  call setinput
  del setinput.bat
  del enter.bat

@ECHO OFF
ECHO.
ECHO Number of Rounds ?
fc /n /lb1 CON NUL|find "1:">%TEMP%.\_L.BAT
ECHO.EXIT|%COMSPEC%/kPROMPT e103'SET V='$_w$_q|debug %TEMP%.\_L.BAT>NUL
FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_L.BAT

:: Check the number is valid
fc /1%V% NUL NUL | find /c "FC:" | find "1">NUL
IF ERRORLEVEL 1 GOTO NOTVALIDnumber

:: Nothing to do if Zero entered
IF (0)==(%V%) GOTO FINISH

REM Initialise a counter file>%TEMP%.\_COUNT
:LOOP

@ECHO OFF
ECHO. @PROMPT e0'$t'$_e3'SET R='$_eb d a 1a$_w3$_q>%TEMP%.\_R.BAT
%COMSPEC% /e:4096 /c %TEMP%.\_R.BAT|debug %TEMP%.\_R.BAT>NUL

FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_R.BAT

start /wait Arena.exe /fcp %input!% /scp %input_% /lgf C:\Arena\Match.PGN /lgi
%R% /mg 2 /inc 0/tc %input&%
SET R=

:: This LOOP is excuted the EnteredNumber times
ECHO.NewLine>>%TEMP%.\_COUNT
TYPE %TEMP%.\_COUNT | find /n "NewLine" | find "[%V%]NewLine">NUL
IF ERRORLEVEL 1 GOTO LOOP

echo.
echo. %input!% - %input_%
ECHO. Rounds Complete - %V%
GOTO FINISH

:NOTVALIDnumber
ECHO. Your entry:[%V%] is not a valid number

:FINISH and tidy up
SET V=
IF EXIST %TEMP%.\_COUNT DEL %TEMP%.\_COUNT

===================[END OF CODE]=====================================

Regards
Dave



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.