home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume20 / notation / part01 next >
Encoding:
Text File  |  1991-06-18  |  56.7 KB  |  1,962 lines

  1. Newsgroups: comp.sources.misc
  2. From: Henry Thomas <hthomas@irisa.fr>
  3. Subject:  v20i052:  notation - chess text handler, Part01/04
  4. Message-ID: <csm-v20i052=notation.001358@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 71bd22a7ccce0ac8f980140f12ca2567
  6. Date: Mon, 17 Jun 1991 05:15:18 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Henry Thomas <hthomas@irisa.fr>
  10. Posting-number: Volume 20, Issue 52
  11. Archive-name: notation/part01
  12. Supersedes: notation: Volume 18, Issue 12-14
  13.  
  14. This program reads chess games, either full algebraic or shortened
  15. (ie Nf1-g3 or f1g3 or Ng3) and is able to ouptut the board after any
  16. move, in ascii form, postscript, or nroff or suitable for some TeX
  17. macros.  Also, it can generate output for gnuan and the xboard
  18. program. It is multi-lingual (european) for piece identification. The
  19. program understand french, english, german, spanish dutch and italian
  20. (send me piece symbols for other languages dannish, swedish,
  21. russian... I will incorporate them happily). The program also accepts
  22. variations and is able to handle symbol-comments.
  23.  
  24.   This program is ok on UNIX (Sun Sparc Station and Sun-3). It uses
  25. standard C, and functions declarations are done in both K&R-C and
  26. ANSI-C.  I guess won't be too difficult to compile on a IBM-PC with
  27. MSC. (I get to work an older function with TURBO-C).
  28.  
  29.   Anyway, if you want to quickly try the program, issue the command
  30. "make" in this directory, and then type "notation algebric.txt" to
  31. test the programm on Kasparov/Karpov game 13 (Lyon, November 1990).
  32. Read and modify the makefile for customizing notation to your national
  33. language and library path.  If you want a complete manual, read
  34. notation.doc.  To print a postscript file, use "print-ps file"
  35.  
  36. ** COPYRIGHT
  37.   This is a freeware program. Commercial use is prohibited. It is free
  38. for non-commercial use.  You have the right to modify it, give it,
  39. provided you don't modify the copyright notice and my name still
  40. remains clearly indicated. For the others packages (Cheq and chess
  41. font) refer to the original copyright notice.
  42.  
  43.   If you're happy with this program, let me know. Also, I'm interested
  44. in any advice to a novice player of chess. I would appreciate if
  45. someone might give me advices about openings: overview, what they are
  46. for, which ones are not too risky for a novice etc... Thanks.
  47.  
  48.   I hope the program is clear enough to be easily modified. Anyway,
  49. I would like to centralize modifications, in order to manage an
  50. up-to-date version. So send me the modifications in forms of diff
  51. files, if possible, along with the version number of the program.
  52.  
  53. Henry Thomas - IRISA          - E-mail: Henry.Thomas@irisa.fr 
  54. Campus Universitaire de Beaulieu - Phone: (+33)99 36 20 00 +549  
  55. 35042 RENNES CEDEX FRANCE      - Fax: (+33)99 38 38 32 Telex: UNIRISA 950473F
  56. Telex Atlas X400: /X121=842950473/@atlas.fr, Fax:/X121=200099383832/@atlas.fr
  57. --
  58. #! /bin/sh
  59. # This is a shell archive.  Remove anything before this line, then unpack
  60. # it by saving it into a file and typing "sh file".  To overwrite existing
  61. # files, type "sh file -c".  You can also feed this as standard input via
  62. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  63. # will see the following message at the end:
  64. #        "End of archive 1 (of 4)."
  65. # Contents:  . CHANGES Footer.ps HELPFILE Header.ps Header.tex MANIFEST
  66. #   Makefile README TODO algebric.txt boudy.txt chesssymb.def
  67. #   chesstype.h convsymb.tex convsymb.txt drivers.h keywords.txt
  68. #   lexer.h lexer.l notation.h print-ps symb.tex symboles.tex
  69. #   symboles.txt
  70. # Wrapped by hthomas@cattus on Sun Jun 16 18:17:27 1991
  71. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  72. if test -f 'CHANGES' -a "${1}" != "-c" ; then 
  73.   echo shar: Will not clobber existing file \"'CHANGES'\"
  74. else
  75. echo shar: Extracting \"'CHANGES'\" \(794 characters\)
  76. sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
  77. X** 24/01/91 THe program sould be ANSI-C. At last, it compiles with "gcc
  78. X-ansi -pedantic"
  79. X
  80. X** 24/04/91 Cleaned-up a few bugs, and added -i and -v options. 
  81. X
  82. X** 16/04/91 NEW NEW version: now handles variations and codified
  83. Xcomment, as well as specials strings as title, subtitle, score and
  84. Xcomments.
  85. X
  86. X** 12/04/91 added the following languages: czech, hungarian, polish,
  87. Xromanian, FIDE. Thanks to Lael.
  88. X
  89. X** 11/05/91 NEW VERSION. Many many improvements: en-passant,
  90. Xpromotion. Split the source in many differents file. Programming style
  91. Ximproved etc...
  92. X
  93. X** 20/03/91 gnu driver has change. It is now named "xchess". The "gnu"
  94. Xname is now used for "gnuan" type files.
  95. X
  96. X** much improved latex output
  97. X
  98. X** improved internal move generation
  99. X
  100. X** added @special keyword, to directly include text in output
  101. END_OF_FILE
  102. if test 794 -ne `wc -c <'CHANGES'`; then
  103.     echo shar: \"'CHANGES'\" unpacked with wrong size!
  104. fi
  105. # end of 'CHANGES'
  106. fi
  107. if test -f 'Footer.ps' -a "${1}" != "-c" ; then 
  108.   echo shar: Will not clobber existing file \"'Footer.ps'\"
  109. else
  110. echo shar: Extracting \"'Footer.ps'\" \(196 characters\)
  111. sed "s/^X//" >'Footer.ps' <<'END_OF_FILE'
  112. X2 ENDPAGE
  113. X%%PageTrailer
  114. X%%PageFonts: Times-Roman Cheq 
  115. X%%PageBoundingBox: 20 20 576 756 
  116. X%%Trailer
  117. Xend %PROLOGUE
  118. X%%Pages: 1 
  119. X%%BoundingBox: 20 20 576 756 
  120. X%%DocumentFonts: Times-Roman Cheq 
  121. X%%EOF
  122. END_OF_FILE
  123. if test 196 -ne `wc -c <'Footer.ps'`; then
  124.     echo shar: \"'Footer.ps'\" unpacked with wrong size!
  125. fi
  126. # end of 'Footer.ps'
  127. fi
  128. if test -f 'HELPFILE' -a "${1}" != "-c" ; then 
  129.   echo shar: Will not clobber existing file \"'HELPFILE'\"
  130. else
  131. echo shar: Extracting \"'HELPFILE'\" \(1160 characters\)
  132. sed "s/^X//" >'HELPFILE' <<'END_OF_FILE'
  133. XCommand line options:
  134. Xnotation [options]
  135. X    where options are
  136. X    -a        : algebraic move notation output
  137. X    -s        : shortened move notation output
  138. X    -f <language>    : specify the chess symbol input language .The
  139. X            language  can be any of:
  140. X        french, english, italian, spanish, german, dutch, 
  141. X        czech, hungarian, polish, romanian, FIDE.
  142. X        (portuguese symbols are the same as spanish)
  143. X    -t <language>    : specify the chess symbol output language.
  144. X            Same options as input language
  145. X    <inputfile>    : specify the input file. If none, keyboard is assumed
  146. X    -o <outputfile>    : specify the output file. If none, screen is assumed
  147. X    -c <number>[,<number]    : specify the number of the moves to display
  148. X            the board. if none, board is diplayed at end of file
  149. X    -e <number>     : display the board at the move number and then stops
  150. X    -b        : display only the board, not the moves
  151. X    -d <drivername>    : specify the output driver. It can be any of
  152. X            the following:
  153. X        ascii
  154. X        postscript
  155. X        tex     (latex)
  156. X        roff
  157. X        xchess     (xchess save format)
  158. X        gnu    (gnuan input format)
  159. X    -i              : suppress headers/footer in output (useful
  160. X            for tex/ps drivers)
  161. X    -h        : shows this help
  162. X    -v        : shows version number
  163. X
  164. END_OF_FILE
  165. if test 1160 -ne `wc -c <'HELPFILE'`; then
  166.     echo shar: \"'HELPFILE'\" unpacked with wrong size!
  167. fi
  168. # end of 'HELPFILE'
  169. fi
  170. if test -f 'Header.ps' -a "${1}" != "-c" ; then 
  171.   echo shar: Will not clobber existing file \"'Header.ps'\"
  172. else
  173. echo shar: Extracting \"'Header.ps'\" \(2180 characters\)
  174. sed "s/^X//" >'Header.ps' <<'END_OF_FILE'
  175. X%!PS-Adobe-2.1
  176. X%%% HOW TO USE:  from Unix, "cat Cheq Example | lpr -Pprintername "
  177. X%%Title: Cheq.cheqtxtx
  178. X%%Creator: Glenn Reid and still.ps (V 1.0d release 10 edit 08)
  179. X%%BoundingBox: (atend)
  180. X%%Pages: (atend)
  181. X%%DocumentProcSets: Adobe_distill 0.95
  182. X%%EndComments
  183. X%%BeginProcSet: Adobe_distill 0.95
  184. X/PROLOGUE 30 40 add dict def
  185. X % 30 procedure entries + room for 40 cached font dictionaries
  186. X PROLOGUE begin
  187. X /clip { } def    % causes problems. remove if "clip" is needed
  188. X /bdef { bind def } bind def    /ldef { load def } bdef
  189. X /T { moveto show } bdef    /A { moveto ashow } bdef
  190. X /W { moveto widthshow } bdef    /AW { moveto awidthshow } bdef
  191. X /f /fill ldef            /R { { rlineto } repeat } bdef
  192. X /r /rlineto ldef        /L { { lineto } repeat } bdef
  193. X /m /moveto ldef        /l { moveto lineto stroke } bdef
  194. X /x { 0 rlineto } bdef        /y { 0 exch rlineto } bdef
  195. X /c /curveto ldef        /cp /closepath ldef
  196. X /s /stroke ldef        /w /setlinewidth ldef
  197. X /g /setgray ldef        /j /setlinejoin ldef
  198. X /d /setdash ldef        /F /setfont ldef
  199. X /C /setcmykcolor where { /setcmykcolor get }{ %ifelse
  200. X   { %def
  201. X     1 sub 3 { 3 index add neg dup 0 lt { pop 0 } if 3 1 roll } repeat
  202. X     setrgbcolor
  203. X   } bind
  204. X } ifelse def
  205. X /MF { findfont exch makefont setfont } bdef
  206. X /DF { findfont exch scalefont setfont currentfont def } bdef
  207. X /BEGINPAGE { pop /pagesave save def } bdef
  208. X /ENDPAGE { pop pagesave restore showpage } def
  209. X /REMAP { %def
  210. X   FontDirectory 2 index known { pop pop pop } { %ifelse
  211. X     findfont dup length dict begin
  212. X       { 1 index /FID ne {def}{pop pop} ifelse } forall
  213. X       exch dup length 0 gt { /Encoding exch def }{ pop } ifelse
  214. X     currentdict end definefont pop
  215. X   } ifelse
  216. X } bdef
  217. X /RECODE { %def
  218. X    3 -1 roll 1 index findfont /Encoding get 256 array copy exch
  219. X    0 exch { %forall
  220. X     dup type/nametype eq
  221. X       { 3 {2 index} repeat put pop 1 add }{ exch pop }ifelse
  222. X    } forall pop 3 1 roll REMAP
  223. X } bdef
  224. X end %PROLOGUE
  225. X%%EndProcSet: Adobe_distill 0.95
  226. X%%EndProlog
  227. X%%BeginSetup
  228. XPROLOGUE begin
  229. X
  230. X%%EndSetup
  231. X%%Page: 1 1
  232. X%%PageFonts: (atend)
  233. X%%PageBoundingBox: (atend)
  234. X1 BEGINPAGE
  235. X1 1 1 0 C
  236. X/F1 12 /Times-Roman DF
  237. X(output of program notation, using font Cheq \(gift of Adobe Systems\))
  238. X72 756 T
  239. X/F2 30 /Cheq DF
  240. END_OF_FILE
  241. if test 2180 -ne `wc -c <'Header.ps'`; then
  242.     echo shar: \"'Header.ps'\" unpacked with wrong size!
  243. fi
  244. # end of 'Header.ps'
  245. fi
  246. if test -f 'Header.tex' -a "${1}" != "-c" ; then 
  247.   echo shar: Will not clobber existing file \"'Header.tex'\"
  248. else
  249. echo shar: Extracting \"'Header.tex'\" \(2509 characters\)
  250. sed "s/^X//" >'Header.tex' <<'END_OF_FILE'
  251. X% Header for chess printing
  252. X\documentstyle[twocolumn]{article}
  253. X\font\chess=chess20
  254. X\font\figchess=chessfig10
  255. X%
  256. X%%%%%%%%%
  257. X%% FIGURES
  258. X\newcommand{\FigK}{{\figchess K}}
  259. X\newcommand{\FigQ}{{\figchess Q}}
  260. X\newcommand{\FigR}{{\figchess R}}
  261. X\newcommand{\FigB}{{\figchess B}}
  262. X\newcommand{\FigN}{{\figchess N}}
  263. X\newcommand{\FigPawn}{{\figchess P}}
  264. X\newcommand{\FigP}{}
  265. X\newcommand{\FigVoid}{}
  266. X\newcommand{\FigDash}{--}
  267. X\newcommand{\FigCapt}{$\times$}
  268. X%\newcommand{\FigDots}{~$\ldots$,}
  269. X\newcommand{\FigDots}{$\ldots$}
  270. X\newcommand{\FigDot}{\char46}
  271. X%
  272. X% inclusion of comments definition
  273. X\input{chesssymb.tex}
  274. X%
  275. X% white pieces on white
  276. X\def\WKW{{\chess K}}
  277. X\def\WQW{{\chess Q}}
  278. X\def\WRW{{\chess R}}
  279. X\def\WBW{{\chess B}}
  280. X\def\WNW{{\chess N}}
  281. X\def\WPW{{\chess P}}
  282. X% white pieces on black
  283. X\def\WKB{{\chess J}}
  284. X\def\WQB{{\chess L}}
  285. X\def\WRB{{\chess S}}
  286. X\def\WBB{{\chess A}}
  287. X\def\WNB{{\chess M}}
  288. X\def\WPB{{\chess O}}
  289. X% black pieces on white
  290. X\def\BKW{{\chess k}}
  291. X\def\BQW{{\chess q}}
  292. X\def\BRW{{\chess r}}
  293. X\def\BBW{{\chess b}}
  294. X\def\BNW{{\chess n}}
  295. X\def\BPW{{\chess p}}
  296. X% black pieces on black
  297. X\def\BKB{{\chess j}}
  298. X\def\BQB{{\chess l}}
  299. X\def\BRB{{\chess s}}
  300. X\def\BBB{{\chess a}}
  301. X\def\BNB{{\chess m}}
  302. X\def\BPB{{\chess o}}
  303. X% white empty 
  304. X\def\WWW{{\chess 0}}
  305. X% black empty */
  306. X\def\DDD{{\chess Z}}
  307. X%
  308. X\def\vvrule{\vrule width1pt} \def\hhrule{\hrule height1pt}
  309. X%%%%%%%%%%%%%%%%%%%%%%%%
  310. X% Movements macros
  311. X%%
  312. X% dumb definitions
  313. X\newcommand{\MoveNumber}[1]{{#1}\ }
  314. X\newcommand{\WhiteMove}[1]{{#1}\ }
  315. X\newcommand{\BlackMove}[1]{{#1}\ }
  316. X%
  317. X% These macros display one move per line
  318. X\newcommand{\ChessModeV}{%
  319. X\renewcommand{\MoveNumber}[1]{~\newline \noindent\makebox[1.5cm][r]{##1}}%
  320. X\renewcommand{\WhiteMove}[1]{\makebox[2cm][r]{##1}}%
  321. X\renewcommand{\BlackMove}[1]{\makebox[2cm][r]{##1} }%
  322. X}
  323. X%
  324. X% These macros display many moves per line
  325. X\newcommand{\ChessModeH}{%
  326. X\renewcommand{\MoveNumber}[1]{{##1}\ }%
  327. X\renewcommand{\WhiteMove}[1]{{##1}\ }%
  328. X\renewcommand{\BlackMove}[1]{{##1}\ }%
  329. X}
  330. X%% Here we define tthe two mode, for the main line and the variation
  331. X\newcommand{\MainLine}{\ChessModeH}
  332. X\newcommand{\VariationLine}{\ChessModeH}
  333. X\MainLine
  334. X%
  335. X%
  336. X\newcommand{\bc}{\begin{center}}
  337. X\newcommand{\ec}{\end{center}}
  338. X%
  339. X\newcommand{\ChessTitle}[1]{\bc{\large\bf #1}\ec}
  340. X\newcommand{\ChessSubTitle}[1]{\bc{\sc #1}\ec}
  341. X\newcommand{\ChessScore}[1]{{\bf #1}}
  342. X%
  343. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  344. X\begin{document}
  345. X%\title{Notation Output}
  346. X%\author{notation program (C) Henry Thomas 1990}
  347. X%\date{\today}
  348. X%\maketitle
  349. END_OF_FILE
  350. if test 2509 -ne `wc -c <'Header.tex'`; then
  351.     echo shar: \"'Header.tex'\" unpacked with wrong size!
  352. fi
  353. # end of 'Header.tex'
  354. fi
  355. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  356.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  357. else
  358. echo shar: Extracting \"'MANIFEST'\" \(0 characters\)
  359. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  360. END_OF_FILE
  361. if test 0 -ne `wc -c <'MANIFEST'`; then
  362.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  363. fi
  364. # end of 'MANIFEST'
  365. fi
  366. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  367.   echo shar: Will not clobber existing file \"'Makefile'\"
  368. else
  369. echo shar: Extracting \"'Makefile'\" \(2915 characters\)
  370. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  371. X# Makefile for notation program
  372. X# (C) Henry Thomas 1990
  373. X
  374. XFILES      = notation.c drivers.c lexer.c lexer.l
  375. XHEADERS       = notation.h drivers.h lexer.h chesstype.h chesssymb.def
  376. X#LIBDIR     = ./lib
  377. XLIBDIR     = .
  378. XBINDIR=$(HOME)/local/bin.$(HOSTTYPE)
  379. X
  380. XOBJECTS    = notation.o drivers.o lexer.o
  381. X
  382. XOTHERFILES = Makefile HELPFILE \
  383. X    keywords.txt algebric.txt shortened.txt boudy.txt\
  384. X    notation.doc notation.n \
  385. X    README TODO COPYING CHANGES \
  386. X    print-ps \
  387. X    Header.ps Footer.ps Header.tex \
  388. X    convsymb.txt convsymb.tex \
  389. X    symboles.txt symboles.tex symb.tex
  390. X
  391. X
  392. XSAVEFILES  = $(FILES) $(HEADERS) $(OTHERFILES)
  393. X
  394. XKITNAME       = "Notation"
  395. X
  396. X############################################################
  397. X# you might want to define the lib path : 
  398. X#    do not forget the trailing /
  399. X# ( the library is the place where the HELPFILE, Heading, fonts etc are)
  400. X# also you can have default language for input/ouput
  401. X# define DEFAULT_INPUT_LANGUAGE and DEFAULT_OUPUT_LANGUAGE
  402. X# value can be:
  403. X#    FRENCH, ENGLISH, GERMAN, ITALIAN, SPANISH, DUTCH
  404. X# ANSI C/ TURBO C (MSDOS)
  405. X# to compile with TURBO C or ANSI C, define TURBOC
  406. XCFLAGS     = -DLIB_DIR=\"$(HOME)/echecs/Notation/\" \
  407. X-DDEFAULT_INPUT_LANGUAGE=FRENCH -DDEFAULT_OUTPUT_LANGUAGE=FRENCH 
  408. XLDFLAGS    =
  409. X
  410. X
  411. XLEX= flex
  412. X
  413. X#CC= gcc -ansi -pedantic
  414. X
  415. X############################################################
  416. X
  417. X.KEEPSTATE:
  418. X
  419. Xall: notation notation.doc chesssymb.tex
  420. X
  421. Xlexer.c: lexer.l chesstype.h
  422. X    $(LEX) -t lexer.l > lexer.c
  423. X
  424. Xnotation: $(OBJECTS)
  425. X    $(CC) $(CFLAGS) -o notation  $(OBJECTS) 
  426. X
  427. Xsymboles.txt:  chesssymb.def convsymb.txt
  428. X    /lib/cpp -P convsymb.txt| sed -e "s/\\\\//" |\
  429. X    sed -e 's/\"//g' | cat -s > symboles.txt
  430. X
  431. Xsymb.tex:  chesssymb.def convsymb.tex
  432. X    /lib/cpp -P convsymb.tex | sed -e 's/\\\\/\\/g' |\
  433. X    sed -e 's/\"//g' | cat -s > symb.tex
  434. Xsymboles.dvi: symboles.tex symb.tex
  435. X    latex symboles.tex
  436. X
  437. Xkit     : $(SAVEFILES)
  438. X    makekit -n$(KITNAME) $(LIBDIR) $(SAVEFILES) MANIFEST > MANIFEST
  439. X
  440. Xshar     : $(SAVEFILES)
  441. X    shar -o$(KITNAME).shar $(LIBDIR) $(SAVEFILES) 
  442. X    compress -f $(KITNAME).shar
  443. X
  444. Xtar     : $(SAVEFILES)
  445. X    tar -cvf - $(SAVEFILES) > $(KITNAME).tar
  446. X    compress -f $(KITNAME).tar
  447. X
  448. Xzoo    : $(SAVEFILES)
  449. X#    chmod +w $(KITNAME).zoo
  450. X    zoo -freshen $(KITNAME).zoo $(SAVEFILES)
  451. X    rm -f $(KITNAME).bak
  452. X#    chmod -w $(KITNAME).zoo
  453. X
  454. Xsauve   :
  455. X    make zoo
  456. X#    chmod +w $(KITNAME).zoo
  457. X    cp $(KITNAME).zoo $(HOME)/local/sauve
  458. X#    chmod -w $(KITNAME).zoo
  459. X
  460. Xinstall: HELPFILE
  461. X    make notation
  462. X    strip notation
  463. X    chmod +x print-ps
  464. X    make notation.doc 
  465. X    make chesssymb.txt
  466. X
  467. Xhthomas:
  468. X    make install
  469. X    mv notation $(BINDIR)
  470. X
  471. Xclean:
  472. X    rm -f notation $(OBJECTS) lexer.c
  473. X    rm -f $(KITNAME).shar[.Z] $(KITNAME).tar[.Z] $(KITNAME)0? MANIFEST
  474. X
  475. Xnotation.doc: notation.n
  476. X    nroff -man notation.n > notation.doc
  477. X
  478. X
  479. X# DO NOT DELETE THIS LINE -- make depend depends on it.
  480. X
  481. Xdrivers.o: chesstype.h notation.h drivers.h chesssymb.def
  482. Xlexer.o: chesstype.h notation.h lexer.h chesssymb.def
  483. Xnotation.o: chesstype.h drivers.h notation.h lexer.h chesssymb.def
  484. END_OF_FILE
  485. if test 2915 -ne `wc -c <'Makefile'`; then
  486.     echo shar: \"'Makefile'\" unpacked with wrong size!
  487. fi
  488. # end of 'Makefile'
  489. fi
  490. if test -f 'README' -a "${1}" != "-c" ; then 
  491.   echo shar: Will not clobber existing file \"'README'\"
  492. else
  493. echo shar: Extracting \"'README'\" \(4568 characters\)
  494. sed "s/^X//" >'README' <<'END_OF_FILE'
  495. X** DESCRIPTION
  496. X  This program read chess games, either full algebraic or shortened
  497. X(ie Nf1-g3 or f1g3 or Ng3) and is able to ouptut the board after any
  498. Xmove, in ascii form, postscript, or nroff or suitable for some TeX
  499. Xmacros.  Also, it can genearte output for gnuan and the xboard
  500. Xprogram. It is multi-lingual (european) for piece identification. The
  501. Xprogram understand french, english, german, spanish dutch and italian
  502. X(send me piece symbols for other languages dannish, swedish,
  503. Xrussian... I will incorporate them happily). The program also accept
  504. Xvariations and is able to handle symbol-comments
  505. X
  506. XThis is a freeware program. You have the right to modify it, give it,
  507. Xprovided you don't modify the copyright notice and my name still
  508. Xremains.  The distribution has 4 shar-type files.
  509. X
  510. X** COMPATIBILITY
  511. X  This program is ok on UNIX (Sun Sparc Station and Sun-3). It uses
  512. Xstandard C, and fonctions declarations are done in both K&R-C and
  513. XANSI-C.  I guess won't be too difficult to compile on a IBM-PC with
  514. XMSC. (I get to work an older function with TURBO-C).
  515. X
  516. X** QUICK USE
  517. X  Anyway, you want to try quickly the program, issue the command
  518. X"make" in this directory, and then type "notation algebric.txt" to
  519. Xtest the programm on Kasparov/Karpov game 13 (Lyon, November 1990).
  520. XRead and modify the makefile for customizing notation to your national
  521. Xlanguage and library path.  If you want a complete manual, read
  522. Xnotation.doc.  To print a postscript file, use "print-ps file"
  523. X
  524. X** SOURCES
  525. X  They are posted to "comp.sources.misc". You can also get them by
  526. Xmail, from "hthomas@irisa.fr". I put them on anonymous ftp on
  527. Xwuarchive.wustl.edu, (user:anonymous, password:<your address>). The
  528. Xpath is "pub/Notation.tar.Z". I may submit them to "garbo.uwasa.fi. 
  529. X
  530. X** IMPORTANT
  531. X  If you want to use PostScript or LaTeX, you need two packages not
  532. Xprovided here. However, here is a way to get them:
  533. X
  534. X**** Postscript: 
  535. X  You need the font "Cheq", freely distributed by Adobe.  Send a mail
  536. Xto "ps-file-server@adobe.com" with the body "send Programs
  537. Xchessfont.ps". For use with "notation", rename the file "Cheq".
  538. X
  539. X------------------------------------------------------------------
  540. Xchessfont.ps              58548 Jun 22 1989
  541. X    This is the Adobe chess font "Cheq", created by John Renner. It 
  542. X    is an ASCII downloadable version of the font that is not in any 
  543. X    particular font format for a specific platform. See also
  544. X    "chessfontUNIX.shar" and "chessfontMAC.shar" for the font bundled 
  545. X    with other useful files like screen fonts and AFM files. If you 
  546. X    just want the font, it is available in this file separately for 
  547. X    convenience.
  548. X------------------------------------------------------------------
  549. X
  550. X**** LaTeX: 
  551. X  You need the chess fonts designed by Piet Tutalaers
  552. X"rcpt@urc.tue.nl". The complete distribution is available 
  553. X
  554. X-- by ftp : on sol.cs.ruu.nl (131.211.80.5) with path TEX/chess.tar.Z
  555. X(please restrict access to weekends or evening/night (i.e.  between
  556. Xabout 2000 and 0.900 UTC)).
  557. X
  558. X------------------------------------------------------------------
  559. X-rw-r--r--  1 piet     staff        2984 Dec  3 10:11 chess.README
  560. X-rwxr--r--  1 piet     staff      129679 Dec  3 15:57 chess.tar.Z
  561. X------------------------------------------------------------------
  562. X
  563. X-- by e-mail : send the following message to 
  564. Xmail-server@cs..ruu.nl (or uunet!mcsun!hp4nl!ruuinf):
  565. X
  566. Xbegin
  567. Xpath john@highbrown.edu
  568. Xsend TEX/chess.tar.Z
  569. Xend
  570. X
  571. XThe path command can be deleted if we receive a valid from address in
  572. Xyour message. If this is the first time you use the mail server, we
  573. Xsuggest you first issue the request:
  574. Xsend help
  575. X
  576. X
  577. X** DOCUMENTATION
  578. X  See the file notation.doc for any info
  579. X
  580. X** COPYRIGHT
  581. X
  582. X  This is a freeware program. Commercial use is prohibited. It is free
  583. Xfor non-commercial use.  You have the right to modify it, give it,
  584. Xprovided you don't modify the copyright notice and my name still
  585. Xremains clearly indicated. For the others packages (Cheq and chess
  586. Xfont) refer to the original copyright notice.
  587. X
  588. X** USER FEEDBACK
  589. X
  590. X  If you're happy with this program, let me know. Also, I'm interested
  591. Xin any advice to a novice player of chess. I would appreciate if
  592. Xsomeone might give me advices obout openings: overview, what they are
  593. Xfor, which ones are not too risky for a novice etc... Thanks.
  594. X
  595. X
  596. X** MODIFICATIONS
  597. X
  598. X  I hope the program to be clear enough to be easily modified. Anyway,
  599. XI would like to centralize modification, in order to manage an
  600. Xup-to-date version. So send me the modification, in forms of diff
  601. Xfiles, if possible, along with the version number of the program.
  602. END_OF_FILE
  603. if test 4568 -ne `wc -c <'README'`; then
  604.     echo shar: \"'README'\" unpacked with wrong size!
  605. fi
  606. # end of 'README'
  607. fi
  608. if test -f 'TODO' -a "${1}" != "-c" ; then 
  609.   echo shar: Will not clobber existing file \"'TODO'\"
  610. else
  611. echo shar: Extracting \"'TODO'\" \(372 characters\)
  612. sed "s/^X//" >'TODO' <<'END_OF_FILE'
  613. XThings to do:
  614. X - command line specification of chess symbols for a new language
  615. X - to have configuration file
  616. X - automatically add sufixes (.tex, ps, .asc, .roff xboard.save ...) to
  617. Xoutput file
  618. X - detect check
  619. X - a binary save format, allowing another program to interactively
  620. Xreplay the game (isn't there a commercial program called chessbase to
  621. Xdo the same thing :-) ?)
  622. END_OF_FILE
  623. if test 372 -ne `wc -c <'TODO'`; then
  624.     echo shar: \"'TODO'\" unpacked with wrong size!
  625. fi
  626. # end of 'TODO'
  627. fi
  628. if test -f 'algebric.txt' -a "${1}" != "-c" ; then 
  629.   echo shar: Will not clobber existing file \"'algebric.txt'\"
  630. else
  631. echo shar: Extracting \"'algebric.txt'\" \(958 characters\)
  632. sed "s/^X//" >'algebric.txt' <<'END_OF_FILE'
  633. X
  634. X[WORLD CHESS CHAMPIONSHIP]
  635. X[GAME 13 Adjourned]
  636. X[November 24, 1990]
  637. X
  638. X[   KARPOV      KASPAROV]
  639. X 1. d2-d4      g8-f6
  640. X 2. c2-c4      g7-g6
  641. X 3. b1-c3      d7-d5
  642. X 4. c4Xd5      f6Xd5
  643. X 5. e2-e4      d5Xc3
  644. X 6. b2Xc3      f8-g7
  645. X 7. c1-e3      c7-c5
  646. X 8. d1-d2       O-O
  647. X 9. a1-c1      d8-a5
  648. X10. g1-f3      e7-e6
  649. X11. d4-d5      e6Xd5
  650. X12. e4Xd5      f8-e8
  651. X13. f1-e2      c8-f5
  652. X14.  O-O       b8-d7
  653. X15. h2-h3      d7-b6
  654. X16. g2-g4      f5-d7
  655. X17. c3-c4      a5Xd2
  656. X18. f3Xd2      b6-a4
  657. X19. e2-f3      a4-c3
  658. X20. c1Xc3      g7Xc3
  659. X21. d2-e4      e8Xe4
  660. X22. f3Xe4      a8-e8
  661. X23. e4-d3      b7-b6
  662. X24. g1-g2      f7-f5
  663. X25. g4Xf5      d7Xf5
  664. X26. d3Xf5      g6Xf5
  665. X27. f1-d1      g8-f7
  666. X28. d1-d3      c3-f6
  667. X29. d3-a3      a7-a5
  668. X30. a3-b3      f6-d8
  669. X31. b3-c3      d8-c7
  670. X32. a2-a4      f7-f6
  671. X33. g2-f1      f5-f4
  672. X34. e3-c1      f6-f5
  673. X35. c3-c2      e8-g8
  674. X36. c2-e2      c7-e5
  675. X37. c1-b2      e5-d4
  676. X38. b2Xd4      c5Xd4
  677. X39. e2-e7      d4-d3
  678. X40. f1-e1      g8-c8
  679. X41. e1-d2      c8Xc4
  680. X
  681. X
  682. X
  683. END_OF_FILE
  684. if test 958 -ne `wc -c <'algebric.txt'`; then
  685.     echo shar: \"'algebric.txt'\" unpacked with wrong size!
  686. fi
  687. # end of 'algebric.txt'
  688. fi
  689. if test -f 'boudy.txt' -a "${1}" != "-c" ; then 
  690.   echo shar: Will not clobber existing file \"'boudy.txt'\"
  691. else
  692. echo shar: Extracting \"'boudy.txt'\" \(864 characters\)
  693. sed "s/^X//" >'boudy.txt' <<'END_OF_FILE'
  694. X@title{Boudy vs Szabo, Varna 1979}
  695. X@subtitle{See Informant XXVII game 452}
  696. X@language{french}
  697. X1. e4 c5 
  698. X2 Cf3 Cc6 
  699. X3 d4 cd4
  700. X4  Cd4 Cf6
  701. X5 Cc3 d6
  702. X6. f4 a6 
  703. X7. Cc6 bc6 
  704. X8. e5 Cd7
  705. X9. ed6 ed6 
  706. X10. Df3 d5
  707. X11. Fd2 Fd6 
  708. X12. o-o-o 0-0
  709. X13. g4 Fb7 { Tb8 !? ~ } 
  710. X14. Tg1 Te8
  711. X15. g5 f5 !? {Cc5}
  712. X16. g6 h6
  713. X17. Fd3 ?! { Fh3! +_} Tf8
  714. X18. Dh3 Df6
  715. X19. Tg5 Cc5
  716. X20. Ff5 Fc8!
  717. X21. Fc8 Tac8
  718. X22. Tg4 Tb8 =~ 
  719. X23. Tf1 Ce4
  720. X24. Fe1 @showboard Tb2
  721. X25. Rb2 { Ce4 de4 26 Fc3 Fa3! 27. Ff6 Tb3 _+ $end } Fa3!
  722. X26. Ra3 {26 Ra1 Tb8 -+} Tb8 -+
  723. X27. Ce4 De7 ?? {27. ... Db2 28. Ra4 Da2 29. Da3 Dc2 30. Ra5 Tb5 
  724. X   31. Ra6 De4 /\[De8a8 -+]}
  725. X28.  Cd6! { 28. Ra4 De4 -+} Dd6
  726. X29. Ra4 c5
  727. X30. Th4 { $bei 30. Tg1 c4 31 Dc3 Dd7 32. Ra3 Dd6 33 Dd4 -+ } c4
  728. X31. Dc3 Dd7 
  729. X32. Ra3 De7 
  730. X33. Db4! +- Tb4 
  731. X34. Fb4 Dh4
  732. X35. Te1 Dd8 [] 
  733. X36. c3! a5
  734. X37. Fc5 || 
  735. X
  736. X@score{White won} [ somewhat luckily in the end at move 75.]
  737. X
  738. END_OF_FILE
  739. if test 864 -ne `wc -c <'boudy.txt'`; then
  740.     echo shar: \"'boudy.txt'\" unpacked with wrong size!
  741. fi
  742. # end of 'boudy.txt'
  743. fi
  744. if test -f 'chesssymb.def' -a "${1}" != "-c" ; then 
  745.   echo shar: Will not clobber existing file \"'chesssymb.def'\"
  746. else
  747. echo shar: Extracting \"'chesssymb.def'\" \(4754 characters\)
  748. sed "s/^X//" >'chesssymb.def' <<'END_OF_FILE'
  749. X/*
  750. X  chess symbols : arguments (all are strings)
  751. X  0: ident
  752. X  1: ascii name
  753. X  2: ascii abbrev
  754. X  3: TeX name
  755. X  4: Postscript name (Mr. Walker font)
  756. X  5: english text
  757. X  6: french text
  758. X  */
  759. X
  760. XCHESSSYMB ( COM_CHK, "+", "+" ,  "+", "",
  761. X       "check",
  762. X       "echec" )
  763. XCHESSSYMB ( COM_DCK, "++", "++" ,  "++", "",
  764. X       "double check",
  765. X       "echec double" )
  766. XCHESSSYMB ( COM_WSB, "$wsb", "+=", "\\COMwsb", "",
  767. X       "white stands lightly better",
  768. X       "les blancs ont un jeu un peu meilleur" )
  769. XCHESSSYMB ( COM_BSB, "$bsb", "=+", "\\COMbsb", "",
  770. X       "black stands lightly better",
  771. X       "les noirs ont un jeu un peu meilleur" )
  772. XCHESSSYMB ( COM_WBE, "$wbe", "+_", "\\COMwbe", "",
  773. X       "white has the upper hand",
  774. X       "les blancs ont le meilleur jeu" )
  775. XCHESSSYMB ( COM_BBE, "$bbe", "_+", "\\COMbbe", "",
  776. X       "black has the upper hand",
  777. X       "les noirs ont le meilleur jeu" )
  778. XCHESSSYMB ( COM_WDA, "$wda", "+-", "\\COMwda", "",
  779. X       "white has a decisive advantage",
  780. X       "les blancs ont un avantage de'cisif" )
  781. XCHESSSYMB ( COM_BDA, "$bda", "-+", "\\COMwda", "",
  782. X       "black has a decisive advantage",
  783. X       "les noirs ont un avantage de'cisif" )
  784. XCHESSSYMB ( COM_EQA, "="  , "=",  "\\COMlev", "",
  785. X       "even",
  786. X       "e'gal" )
  787. XCHESSSYMB ( COM_UCR, "$ucr", "~" ,  "\\COMucr", "",
  788. X       "unclear",
  789. X       "incertain" )
  790. XCHESSSYMB ( COM_WCO, "$wco", "=~" ,  "\\COMwco", "",
  791. X       "with compensation for the material",
  792. X       "avec compensation pour le mate'riel" )
  793. XCHESSSYMB ( COM_DAD, "$dad", "(^)" ,  "\\COMdad", "",
  794. X       "development advantage",
  795. X       "avance de de'veloppement" )
  796. XCHESSSYMB ( COM_SPA, "$spa", "()" ,  "\\COMspa", "",
  797. X       "greater space advantage",
  798. X       "grand avantage d'espace" )
  799. XCHESSSYMB ( COM_WTA, "$wta", "->" ,  "\\COMwta", "",
  800. X       "with attack",
  801. X       "avec attaque" )
  802. XCHESSSYMB ( COM_WIN, "$win", "|^" ,  "\\COMwin", "",
  803. X       "with initiative",
  804. X       "avec initiative" )
  805. XCHESSSYMB ( COM_WCP, "$wcp", "<->" ,  "\\COMwcp", "",
  806. X       "with counter-play",
  807. X       "avec contre-attaque" )
  808. XCHESSSYMB ( COM_ZUG, "$zug", "(.)" ,  "\\COMzug", "",
  809. X       "zugzwang",
  810. X       "zug zwang" )
  811. XCHESSSYMB ( COM_MAT, "#", "#" ,  "\\#", "",
  812. X       "mate",
  813. X       "mat" )
  814. XCHESSSYMB ( COM_VGM, "!", "!" ,  "!", "",
  815. X       "very good move",
  816. X       "un tre`s bon coup" )
  817. XCHESSSYMB ( COM_VBM, "?", "?" ,  "?", "",
  818. X       "very bad move",
  819. X       "un tre`s mauvais coup" )
  820. XCHESSSYMB ( COM_EXM, "!!", "!!" ,  "!!", "",
  821. X       "excellent move",
  822. X       "un excellent coup" )
  823. XCHESSSYMB ( COM_MIS, "??", "??" ,  "??", "",
  824. X       "a mistake",
  825. X       "un coup faible" )
  826. XCHESSSYMB ( COM_MDA, "!?", "!?" ,  "!?", "",
  827. X       "a move deserving attention",
  828. X       "un coup qui me'rite l'attention" )
  829. XCHESSSYMB ( COM_DUM, "?!", "?!" ,  "?!", "",
  830. X       "a dubious move",
  831. X       "un coup d'une valeur douteuse" )
  832. XCHESSSYMB ( COM_WTI, "$wti", "/\\" ,  "\\COMwti", "",
  833. X       "with the idea...",
  834. X       "avec l'ide'e..." )
  835. XCHESSSYMB ( COM_OLM, "$olm", "[]" ,  "\\COMolm", "",
  836. X       "only move",
  837. X       "seul coup possible" )
  838. XCHESSSYMB ( COM_BEI, "$bei", "^_" ,  "\\COMbei", "",
  839. X       "better is",
  840. X       "est meilleur" )
  841. XCHESSSYMB ( COM_FIL, "$fil", "<=>" ,  "\\COMfil", "",
  842. X       "file",
  843. X       "colonne" )
  844. XCHESSSYMB ( COM_DIA, "$dia", "/^" ,  "\\COMdia", "",
  845. X       "diagonal",
  846. X       "diagonale" )
  847. XCHESSSYMB ( COM_CNT, "$cnt", "[+]" ,  "\\COMcnt", "",
  848. X       "center",
  849. X       "centre" )
  850. XCHESSSYMB ( COM_KGS, "$kgs", ">>" ,  "\\COMkgs", "",
  851. X       "king's side",
  852. X       "aile roi" )
  853. XCHESSSYMB ( COM_QNS, "$qns", "<<" ,  "\\COMqns", "",
  854. X       "queen's side",
  855. X       "aile reine" )
  856. XCHESSSYMB ( COM_WKP, "$wkp", "><" ,  "\\COMwkp", "",
  857. X       "weak point",
  858. X       "point faigle" )
  859. XCHESSSYMB ( COM_END, "$end", "_|_" ,  "\\COMend", "",
  860. X       "ending",
  861. X       "finale" )
  862. XCHESSSYMB ( COM_POB, "$pob", "==" ,  "\\COMpob", "",
  863. X       "pair of bishops",
  864. X       "paire de fous" )
  865. XCHESSSYMB ( COM_OPC, "$opc", "=#" ,  "\\COMopc", "",
  866. X       "bishops of opposite colors",
  867. X       "fous de couleurs oppose'es" )
  868. XCHESSSYMB ( COM_SCB, "$scb", "##" ,  "\\COMscb", "",
  869. X       "same coloured bishops",
  870. X       "fous de me^me couleur" )
  871. XCHESSSYMB ( COM_UNP, "$unp", "oo" ,  "\\COMunp", "",
  872. X       "united pawns",
  873. X       "pions unis" )
  874. XCHESSSYMB ( COM_SEP, "$sep", "o..o" ,  "\\COMsep", "",
  875. X       "separated pawns",
  876. X       "pions se'pare's" )
  877. XCHESSSYMB ( COM_DOP, "$dop", "o/o" ,  "\\COMdop", "",
  878. X       "doubled pawns",
  879. X       "pions double's" )
  880. XCHESSSYMB ( COM_TIM, "$tim", "(+)" ,  "\\COMtim", "",
  881. X       "time",
  882. X       "temps" )
  883. XCHESSSYMB ( COM_WIT, "$wit", "|_" ,  "\\COMwit", "",
  884. X       "with",
  885. X       "avec" )
  886. XCHESSSYMB ( COM_WTO, "$wto", "_|" ,  "\\COMwto", "",
  887. X       "without",
  888. X       "sans" )
  889. XCHESSSYMB ( COM_ETC, "etc", "etc" ,  "{etc}", "",
  890. X       "etc",
  891. X       "etc" )
  892. XCHESSSYMB ( COM_ETD, "||", "||" ,  "\\COMetc", "",
  893. X       "etc",
  894. X       "etc" )
  895. XCHESSSYMB ( COM_SEE, "$see", "" ,  "\\COMsee", "",
  896. X       "see",
  897. X       "voir" )
  898. XCHESSSYMB ( COM_ENP, "ep", "ep" ,  "{ep}", "",
  899. X       "en passant",
  900. X       "en passant" )
  901. END_OF_FILE
  902. if test 4754 -ne `wc -c <'chesssymb.def'`; then
  903.     echo shar: \"'chesssymb.def'\" unpacked with wrong size!
  904. fi
  905. # end of 'chesssymb.def'
  906. fi
  907. if test -f 'chesstype.h' -a "${1}" != "-c" ; then 
  908.   echo shar: Will not clobber existing file \"'chesstype.h'\"
  909. else
  910. echo shar: Extracting \"'chesstype.h'\" \(3150 characters\)
  911. sed "s/^X//" >'chesstype.h' <<'END_OF_FILE'
  912. X/*
  913. X  Notation program
  914. X  @(#)chesstype.h    3.1 (C) Henry Thomas\tVersion 3.1\tDated 6/16/91
  915. X */
  916. X
  917. X/* types definition */
  918. X#ifndef _HEADERS_TYPES
  919. X#define _HEADERS_TYPES
  920. X
  921. X#define FALSE 0
  922. X#define TRUE  1
  923. X
  924. X#ifndef NULL
  925. X#define NULL    ((char *) 0)
  926. X#endif
  927. X
  928. X#define MAX(a,b)  ((a)>(b)?(a):(b))
  929. X#define MIN(a,b)  ((a)<(b)?(a):(b))
  930. X#define ABS(a)      ((a)>=0?(a):(-(a)))
  931. X#define SIGN(a)   ((a)>=0?(1):-1)
  932. X
  933. X#define DUMMYCHAR '$'
  934. X#define MAXTOKLEN 1024
  935. X
  936. X
  937. X/* max number of move for displaying board */
  938. X#define NB_MOVE_TO_DISP 128
  939. X
  940. X/* debugging help */
  941. X#ifdef DEBUG
  942. X#define MESSAGE(A) (void) fprintf A
  943. X#define ACTION(A)  A
  944. X#else
  945. X#define MESSAGE(A)
  946. X#define ACTION(A)
  947. X#endif
  948. X
  949. X/* output move format */
  950. X
  951. X#define ALGEBRAIC 0
  952. X#define SHORTENED 1
  953. X
  954. X/* text type */
  955. X#define T_TEXT        1
  956. X#define T_COMMENT    2
  957. X#define T_TITLE        3
  958. X#define T_SUBTITLE    4
  959. X#define T_SCORE        5
  960. X
  961. X/* -------------------------------------------- */
  962. X/*              chess data structures           */
  963. X/* -------------------------------------------- */
  964. X
  965. X#define NUMPIECES 7
  966. X
  967. X#define KING   1
  968. X#define QUEEN  2
  969. X#define ROOK   3
  970. X#define BISHOP 4
  971. X#define KNIGHT 5
  972. X#define PAWN   6
  973. X
  974. X#define VOID  0
  975. X#define WHITE 1
  976. X#define BLACK 2
  977. X
  978. X/* board and move representation */
  979. X/* board size */
  980. X#define SIZE 10 
  981. X
  982. X/* ---- structure to represent the game ---- */
  983. Xtypedef struct {
  984. X
  985. X  /* board definition */
  986. X  int board[SIZE][SIZE];
  987. X  int color[SIZE][SIZE];
  988. X
  989. X} game ;
  990. X/* ---- end of structure ---- */
  991. X
  992. X#define GULL (game *) 0
  993. X
  994. X/* french(roque) == english(castling) */
  995. X
  996. X#define MOVE        1      /* un mouvement        */
  997. X#define PRISE        2          /* une prise           */
  998. X#define GRANDROQUE    3     /* grand roque         */
  999. X#define PETITROQUE    4     /* petit roque         */
  1000. X#define EN_PASSANT    5    /* prise en passant    */
  1001. X#define PROMOTION      6    /* promotion           */
  1002. X#define PROM_ET_PRISE    7    /* promotion + capture */
  1003. X
  1004. X#define SHORT_COMMENT_LEN 4
  1005. X
  1006. X/* structure used to describe the current move */
  1007. Xstruct deplace {
  1008. X  /* system zone */
  1009. X  int uid ;             /* node id */
  1010. X
  1011. X  /* links used to chain moves   */
  1012. X  struct deplace * next ; /* next move     */
  1013. X  struct deplace * prev ; /* previous move */
  1014. X  struct deplace * sub  ; /* variation     */
  1015. X
  1016. X  /* user zone */
  1017. X  int move ;        /* number of the move */
  1018. X  int whiteturn ;     /* boolean to tell white's turn */
  1019. X
  1020. X  int type;        /* type of move: MOVE, PRISE, etc..   */
  1021. X  int piece;        /* type of the piece */
  1022. X
  1023. X  int fromcol, fromlig;    /* from position */
  1024. X  int tocol, tolig ;    /* destination   */
  1025. X
  1026. X  int prise;        /* captured piece */
  1027. X  int promotion;        /* name of the pice the pawn is promoted to */
  1028. X
  1029. X  int is_check ;    /* if does the move provides check ?*/
  1030. X
  1031. X  char comment[SHORT_COMMENT_LEN];    /* short text comment */
  1032. X  char * text ;         /* long text comment */
  1033. X
  1034. X
  1035. X} ;
  1036. Xtypedef struct deplace depl ;
  1037. X
  1038. X#define MULL (depl *) 0
  1039. X
  1040. X#define CURCOLOR(M) (((M)->whiteturn)?(WHITE):(BLACK))
  1041. X#define OPPCOLOR(M) (((M)->whiteturn)?(BLACK):(WHITE))
  1042. X
  1043. X
  1044. X/* structure used to hold a complete play 
  1045. X   this structure is
  1046. X   - an initial board 
  1047. X   - a chain of moves
  1048. X   moves are applied to the board, and coan also be undone
  1049. X   */
  1050. Xtypedef struct {
  1051. X  game * initial;
  1052. X  depl * chain ;
  1053. X} play ;
  1054. X
  1055. X
  1056. X/* end headers */
  1057. X#endif
  1058. END_OF_FILE
  1059. if test 3150 -ne `wc -c <'chesstype.h'`; then
  1060.     echo shar: \"'chesstype.h'\" unpacked with wrong size!
  1061. fi
  1062. # end of 'chesstype.h'
  1063. fi
  1064. if test -f 'convsymb.tex' -a "${1}" != "-c" ; then 
  1065.   echo shar: Will not clobber existing file \"'convsymb.tex'\"
  1066. else
  1067. echo shar: Extracting \"'convsymb.tex'\" \(149 characters\)
  1068. sed "s/^X//" >'convsymb.tex' <<'END_OF_FILE'
  1069. X#define CHESSSYMB(LET,LASC,SASC,TEX,PS,ENG,FRA)\
  1070. XENG & \verb;LASC; & \verb;SASC;    & TEX &  \verb;TEX; \cr  
  1071. X#include "chesssymb.def"
  1072. X#undef CHESSSYMB
  1073. END_OF_FILE
  1074. if test 149 -ne `wc -c <'convsymb.tex'`; then
  1075.     echo shar: \"'convsymb.tex'\" unpacked with wrong size!
  1076. fi
  1077. # end of 'convsymb.tex'
  1078. fi
  1079. if test -f 'convsymb.txt' -a "${1}" != "-c" ; then 
  1080.   echo shar: Will not clobber existing file \"'convsymb.txt'\"
  1081. else
  1082. echo shar: Extracting \"'convsymb.txt'\" \(195 characters\)
  1083. sed "s/^X//" >'convsymb.txt' <<'END_OF_FILE'
  1084. Xcomment    shorthand     english translation
  1085. X------------------------------------------------
  1086. X#define CHESSSYMB(LET,LASC,SASC,TEX,PS,ENG,FRA)\
  1087. XLASC        SASC        ENG
  1088. X#include "chesssymb.def"
  1089. X#undef CHESSSYMB
  1090. END_OF_FILE
  1091. if test 195 -ne `wc -c <'convsymb.txt'`; then
  1092.     echo shar: \"'convsymb.txt'\" unpacked with wrong size!
  1093. fi
  1094. # end of 'convsymb.txt'
  1095. fi
  1096. if test -f 'drivers.h' -a "${1}" != "-c" ; then 
  1097.   echo shar: Will not clobber existing file \"'drivers.h'\"
  1098. else
  1099. echo shar: Extracting \"'drivers.h'\" \(2470 characters\)
  1100. sed "s/^X//" >'drivers.h' <<'END_OF_FILE'
  1101. X/*
  1102. X  Notation program
  1103. X  @(#)drivers.h    3.1 (C) Henry Thomas\tVersion 3.1\tDated 6/16/91
  1104. X */
  1105. X/* headers for output drivers */
  1106. X#ifndef _HEADERS_DRIVERS
  1107. X#define HEADERS_DRIVERS
  1108. X
  1109. X
  1110. X#define D_ASCII  0
  1111. X#define D_POST   1
  1112. X#define D_TEX    2
  1113. X#define D_ROFF   3
  1114. X#define D_XCHESS 4
  1115. X#define D_GNU    5
  1116. X
  1117. X#define NB_DRIVER 6
  1118. X
  1119. X/* variation convention */
  1120. X#define VARIATION_IN 0
  1121. X#define VARIATION_OUT 1
  1122. X
  1123. X
  1124. X#define PS_HEADER  "Header.ps"
  1125. X#define PS_FOOTER  "Footer.ps"
  1126. X#define TEX_HEADER "Header.tex"
  1127. X
  1128. X
  1129. X/* output buffers */
  1130. X#define TAMPON 256
  1131. X
  1132. Xtypedef struct {
  1133. X
  1134. X  /* type of driver */
  1135. X  int type ;
  1136. X
  1137. X  /* output_file */
  1138. X  FILE *outfile ;
  1139. X  /* these  booleans control the output format */
  1140. X  int print_move    ;  /* move numbering */
  1141. X  int print_piece   ;  /* print piece name */
  1142. X  int print_pawn    ; /* print the PAWN name */
  1143. X  int roque_alg     ; /*  roque in algebraic form Ke1g1 or O-O */
  1144. X  int print_liaison ; /* print the - or x in move output */
  1145. X  int only_board ;
  1146. X  int variation     ; /* variation level */
  1147. X  int print_headers ; /* include the header/footer file */
  1148. X
  1149. X  /* boolean to print the coordinates in ascii output of board */
  1150. X  int coordinates   ;
  1151. X  int output_move_format ;
  1152. X
  1153. X  char *out_table;    /* translation table */
  1154. X
  1155. X  /* procedures */
  1156. X  void (*out_init)() ;
  1157. X  void (*out_move)() ;
  1158. X  void (*out_variation)() ;
  1159. X  void (*out_text)() ;
  1160. X  void (*out_board)() ;
  1161. X  void (*out_end)() ;
  1162. X
  1163. X  /* temp vars  used by move buffering */
  1164. X
  1165. X  int iswhiteturn ; /*= FALSE */
  1166. X  int interrupt ; /*= FALSE */
  1167. X
  1168. X  char move_buffer[TAMPON]  /*= ""*/ ;
  1169. X  char white_buffer[TAMPON] /*= ""*/ ;
  1170. X  char black_buffer[TAMPON] /*= ""*/ ;
  1171. X
  1172. X
  1173. X} format ;
  1174. X
  1175. X
  1176. X/* fonctions ----------------- */
  1177. X
  1178. X#ifdef __STDC__
  1179. X
  1180. Xextern void output_init(format *dr);
  1181. Xextern void output_move(format *dr, depl *d);
  1182. Xextern void output_variation(format *dr, int inout);
  1183. Xextern void output_text(format *dr, int type, char *string, int code);
  1184. Xextern void output_board(format *dr, game *g);
  1185. Xextern void output_end(format *dr);
  1186. X
  1187. Xextern format *new_driver(void);
  1188. Xextern void init_driver(format *dr, int driver);
  1189. X
  1190. X#else
  1191. X
  1192. Xextern void output_init(/*format *dr*/);
  1193. Xextern void output_move(/*format *dr, depl *d*/);
  1194. Xextern void output_variation(/*format *dr, int inout*/);
  1195. Xextern void output_text(/*format *dr, int type, char *string, int code*/);
  1196. Xextern void output_board(/*format *dr, game *g*/);
  1197. Xextern void output_end(/*format *dr*/);
  1198. X
  1199. Xextern format *new_driver(/*void*/);
  1200. Xextern void init_driver(/*format *dr, int driver*/);
  1201. X#endif
  1202. X
  1203. X#endif
  1204. END_OF_FILE
  1205. if test 2470 -ne `wc -c <'drivers.h'`; then
  1206.     echo shar: \"'drivers.h'\" unpacked with wrong size!
  1207. fi
  1208. # end of 'drivers.h'
  1209. fi
  1210. if test -f 'keywords.txt' -a "${1}" != "-c" ; then 
  1211.   echo shar: Will not clobber existing file \"'keywords.txt'\"
  1212. else
  1213. echo shar: Extracting \"'keywords.txt'\" \(256 characters\)
  1214. sed "s/^X//" >'keywords.txt' <<'END_OF_FILE'
  1215. X[Example of keywords use]
  1216. X[absolutely non-sense game]
  1217. Xe2-e4 c7c6
  1218. X@showboard
  1219. X@clearboard
  1220. X@showboard
  1221. X@configwhite
  1222. X d4    Nf6
  1223. X Nc3   @showboard d5
  1224. X@configblack
  1225. X Kg8
  1226. X@startplay
  1227. X@whitesmove
  1228. XNc3-b1
  1229. X@showboard
  1230. X@blacksmove
  1231. XRg8-g7 @showboard d5-d6
  1232. XRg7-f6
  1233. X
  1234. X@null
  1235. X
  1236. X
  1237. X
  1238. END_OF_FILE
  1239. if test 256 -ne `wc -c <'keywords.txt'`; then
  1240.     echo shar: \"'keywords.txt'\" unpacked with wrong size!
  1241. fi
  1242. # end of 'keywords.txt'
  1243. fi
  1244. if test -f 'lexer.h' -a "${1}" != "-c" ; then 
  1245.   echo shar: Will not clobber existing file \"'lexer.h'\"
  1246. else
  1247. echo shar: Extracting \"'lexer.h'\" \(309 characters\)
  1248. sed "s/^X//" >'lexer.h' <<'END_OF_FILE'
  1249. X/*
  1250. X  Notation program
  1251. X  @(#)lexer.h    3.1 (C) Henry Thomas\tVersion 3.1\tDated 6/16/91
  1252. X */
  1253. X#ifndef _HEADER_LEXER
  1254. X#define _HEADER_LEXER
  1255. X
  1256. Xextern int column;
  1257. Xextern int lineno;
  1258. X
  1259. Xextern FILE * yyin;
  1260. Xextern FILE * yyout;
  1261. X
  1262. X#ifdef __STDC__
  1263. Xextern int yylex(/*void*/);
  1264. X#else
  1265. Xextern int yylex(/*void*/);
  1266. X#endif
  1267. X
  1268. X
  1269. X#endif
  1270. END_OF_FILE
  1271. if test 309 -ne `wc -c <'lexer.h'`; then
  1272.     echo shar: \"'lexer.h'\" unpacked with wrong size!
  1273. fi
  1274. # end of 'lexer.h'
  1275. fi
  1276. if test -f 'lexer.l' -a "${1}" != "-c" ; then 
  1277.   echo shar: Will not clobber existing file \"'lexer.l'\"
  1278. else
  1279. echo shar: Extracting \"'lexer.l'\" \(3979 characters\)
  1280. sed "s/^X//" >'lexer.l' <<'END_OF_FILE'
  1281. X/* DO NOT REMOVE THIS LINE                      */
  1282. X/*                                              */
  1283. X/* Notation program                             */
  1284. X/* @(#)lexer.l    3.1 (C) Henry Thomas\tVersion 3.1\tDated 6/16/91 */
  1285. X/*                                              */
  1286. X%{
  1287. X#include <stdio.h>
  1288. X
  1289. X#include "chesstype.h"
  1290. X#include"notation.h"
  1291. X
  1292. X#define NCURLINE 1024
  1293. Xchar curline [NCURLINE] ;
  1294. X
  1295. X#define LARGE_BUF 4096
  1296. Xstatic char commbuf[LARGE_BUF];
  1297. X
  1298. Xint column = 0;
  1299. Xint lineno = 1;
  1300. X
  1301. X#ifdef __STDC__
  1302. Xextern void count(void);
  1303. Xextern char * comment(int closing);
  1304. X#else
  1305. Xextern void count();
  1306. Xextern char * comment();
  1307. X#endif
  1308. X
  1309. X%}
  1310. X
  1311. XLEXSHORT [-+!?#]
  1312. XLEXLONG  [-+=/\\\^\&\*\~<>_|#]
  1313. X
  1314. X%%
  1315. X[Oo0]\-?[Oo0](\-?[Oo0])? { /* roque */ ; parse_roque(yytext); }
  1316. X[0-9]+[\.]?            { /* move number */ parse_number(yytext); }
  1317. X[A-Z]?([a-z]([1-8])?)?[-xX]?[a-z][1-8]  { /* move */  
  1318. X  (void) parse_move(yytext);
  1319. X  /*; fprintf(stderr,"%s, ",yytext);*/ 
  1320. X}
  1321. X
  1322. X
  1323. X{LEXLONG}{LEXLONG}{LEXLONG}     { /* comment */ ; 
  1324. X                parse_comment(yytext); }
  1325. X{LEXLONG}{LEXLONG}      { /* comment */ ; 
  1326. X                   parse_comment(yytext); }
  1327. X{LEXSHORT}{LEXSHORT}    { /* comment */ ; 
  1328. X                     parse_comment(yytext); }
  1329. X{LEXLONG}               { /* comment */ ; 
  1330. X               parse_comment(yytext); }
  1331. X{LEXSHORT}              { /* comment */ ; parse_comment(yytext); }
  1332. X"\(\.\)"                { /* comment */ ; parse_comment(yytext); }
  1333. X"\(\*\)"                { /* comment */ ; parse_comment(yytext); }
  1334. X"\(\^\)"                { /* comment */ ; parse_comment(yytext); }
  1335. X"\[\+\]"                { /* comment */ ; parse_comment(yytext); }
  1336. X"\(\)"                  { /* comment */ ; parse_comment(yytext); }
  1337. X"\[\]"                  { /* comment */ ; parse_comment(yytext); }
  1338. X"o\.\.o"                { /* comment */ ; parse_comment(yytext); }
  1339. X"oo"                    { /* comment */ ; parse_comment(yytext); }
  1340. X"o/o"                   { /* comment */ ; parse_comment(yytext); }
  1341. X"@\^"                   { /* comment */ ; parse_comment(yytext); }
  1342. X"etc"                   { /* comment */ ; parse_comment("etc"); }
  1343. X"ep"|"e\.p\."           { /* comment */ ; parse_comment("ep"); }
  1344. X\$[a-z][a-z][a-z]       { /* game comment */ ; parse_comment(yytext); }
  1345. X@[a-z]+\{        { /* keyword with arg */ 
  1346. X  yytext[yyleng -1] = '\0' ;
  1347. X  parse_keyword(yytext, comment('}'));
  1348. X}
  1349. X@[a-z]+            { /* keyword without arg */ 
  1350. X  parse_keyword(yytext,NULL); }
  1351. X"\["            { parse_text(comment(']')); }
  1352. X"\("            { parse_text(comment(')')); }
  1353. X"\{"                    { /* enter variation */ ; enter_variation(); }
  1354. X"\}"            { /* close variation */ ; exit_variation(); }
  1355. X[\,;\.]            { /* skip , ; */ ; }
  1356. X[ \t\v\n\f]             { /* skip blanks */; }
  1357. X.                      { /* ignore bad characters */ (void) fprintf(stderr,"I don't understand: %s\n",yytext);}
  1358. X%%
  1359. X
  1360. X#ifdef FLEX_SCANNER
  1361. X#undef yywrap
  1362. X#endif
  1363. X#ifdef __STDC__
  1364. Xint yywrap(void)
  1365. X#else
  1366. Xint yywrap()
  1367. X#endif
  1368. X{
  1369. X        return(1);
  1370. X}
  1371. X
  1372. X
  1373. X/* this procedure store comments in the text array commbuf
  1374. X   Escape char are allowed for putting the end-of-comment symbol
  1375. X   in the buffer
  1376. X   */
  1377. X#ifdef __STDC__
  1378. Xstatic char * comment(int closing)
  1379. X#else
  1380. Xstatic char * comment(closing)
  1381. X     char closing;
  1382. X#endif
  1383. X{
  1384. X  register char c;
  1385. X  register int i=0;
  1386. X
  1387. X  while ( ((c = input()) != closing)  && (c != 0) && (c != EOF)) {
  1388. X    commbuf[i] = c;
  1389. X    if (i <LARGE_BUF) i++ ;
  1390. X    
  1391. X    if (c == '\\') {
  1392. X      c = input() ;
  1393. X      if (c == closing)
  1394. X    commbuf[i-1] = c;
  1395. X      else
  1396. X    unput(c);
  1397. X    }
  1398. X  }
  1399. X  commbuf[i] = '\0' ;
  1400. X  return(commbuf);
  1401. X}
  1402. X
  1403. X#ifdef __STDC__
  1404. Xstatic void count(void)
  1405. X#else
  1406. Xstatic void count()
  1407. X#endif
  1408. X{
  1409. X  register int i;
  1410. X  register int k;
  1411. X
  1412. X  for (i = 0; yytext[i] != '\0'; i++) {
  1413. X    if (yytext[i] == '\n') {
  1414. X      column = 0;
  1415. X      for (k = 0 ; k< NCURLINE; k++) /*PANDORE*/
  1416. X        curline[k] = ' '; /*PANDORE*/
  1417. X      lineno++;
  1418. X    }
  1419. X    else if (yytext[i] == '\t') {
  1420. X      column += 8 - (column % 8);
  1421. X      curline[column] = yytext[i];
  1422. X    } else {
  1423. X      column++;
  1424. X      curline[column] = yytext[i];
  1425. X    }
  1426. X    curline[column+1]= '\0' ;
  1427. X  }
  1428. X  /*ECHO;*/
  1429. X}
  1430. END_OF_FILE
  1431. if test 3979 -ne `wc -c <'lexer.l'`; then
  1432.     echo shar: \"'lexer.l'\" unpacked with wrong size!
  1433. fi
  1434. # end of 'lexer.l'
  1435. fi
  1436. if test -f 'notation.h' -a "${1}" != "-c" ; then 
  1437.   echo shar: Will not clobber existing file \"'notation.h'\"
  1438. else
  1439. echo shar: Extracting \"'notation.h'\" \(5592 characters\)
  1440. sed "s/^X//" >'notation.h' <<'END_OF_FILE'
  1441. X/*
  1442. X  Notation program
  1443. X  @(#)notation.h    3.1 (C) Henry Thomas\tVersion 3.1\tDated 6/16/91
  1444. X */
  1445. X#ifndef _NOTATION_HEADERS
  1446. X#define _NOTATION_HEADERS
  1447. X
  1448. X
  1449. X/* ---- KEYWORDS ----  */
  1450. X
  1451. X/* prefix for keywords */
  1452. X#define PREFIX '@'
  1453. X
  1454. X
  1455. X#define START     0
  1456. X#define CLEAR     1
  1457. X#define SHOWBOARD 2
  1458. X#define TOWHITE   3
  1459. X#define TOBLACK   4
  1460. X#define CONFIGWH  5
  1461. X#define CONFIGBL  6
  1462. X#define DEFAULTP  7
  1463. X#define TITLE      8
  1464. X#define SUBTITLE  9
  1465. X#define SCORE      10
  1466. X#define LANGUE    11
  1467. X#define SPECIAL   12
  1468. X#define KNULL     13
  1469. X
  1470. X#define NBKEYWORD (KNULL+1)
  1471. X
  1472. X
  1473. X/* ---- LANGUAGES ---- */
  1474. X
  1475. X#define FRENCH         0
  1476. X#define ENGLISH     1
  1477. X#define ITALIAN     2
  1478. X#define SPANISH     3
  1479. X#define GERMAN      4
  1480. X#define DUTCH       5
  1481. X#define CZECH        6
  1482. X#define HUNGARIAN          7
  1483. X#define POLISH        8
  1484. X#define ROMANIAN           9
  1485. X#define FIDE        10
  1486. X
  1487. X#define USERDEF        11
  1488. X
  1489. X#define NBLANGUAGES     (USERDEF+0)
  1490. X
  1491. X#ifndef DEFAULT_INPUT_LANGUAGE
  1492. X#define DEFAULT_INPUT_LANGUAGE  FRENCH
  1493. X#endif
  1494. X
  1495. X#ifndef DEFAULT_OUTPUT_LANGUAGE
  1496. X#define DEFAULT_OUTPUT_LANGUAGE FRENCH
  1497. X#endif
  1498. X
  1499. X
  1500. X/* a convenient way  to get a value for NUM_COMMENT 
  1501. X   look at GNU-CC source, it's full of *neat* tricks 
  1502. X   */
  1503. X
  1504. X#define CHESSSYMB(LET,LASC,SASC,TEX,PS,ENG,FRA) LET,
  1505. X
  1506. Xenum com_code {
  1507. X#include "chesssymb.def"
  1508. X  LAST_UNUSED_NUM_COM_CODE
  1509. X  };
  1510. X#undef CHESSSYMB
  1511. X
  1512. X#define NUM_COM_CODE ((int) LAST_UNUSED_NUM_COM_CODE) 
  1513. X
  1514. X/* ---- MISC TABLES ---- */
  1515. X
  1516. X/* roque ascii table */
  1517. X#define NBROQUE     6
  1518. X#define SPETITROQUE 0
  1519. X#define SGRANDROQUE 1
  1520. X
  1521. X
  1522. X/* ---- DRIVERS ---- */
  1523. X
  1524. X/* output drivers name table */
  1525. X#define DEFAULT_DRIVER D_ASCII
  1526. X
  1527. X/* ---- IO ---- */
  1528. X
  1529. X#ifndef LIB_DIR
  1530. X#define LIB_DIR    "./lib/"
  1531. X#endif
  1532. X
  1533. X#define HELP_FILE  "HELPFILE"
  1534. X
  1535. Xextern FILE * infile;
  1536. X
  1537. X/* ------------- service routines -------------------*/
  1538. X
  1539. X/* Output an error message and exit */
  1540. X#define fatal(A) (void) fprintf A , close_files() , exit(1)
  1541. X
  1542. X/* Output an error message and set the error flag */
  1543. X#define error(A) (void) fprintf A , error_flag = TRUE , (void)fflush(stderr)
  1544. X
  1545. X/* Output an error message and set the error flag */
  1546. X#define message(A) (void) fprintf A 
  1547. X
  1548. X#define MALLOC(T)  (T *)malloc((unsigned)sizeof(T))
  1549. X#define ALLOCP(P)  if ( (P) == NULL ) { fatal(("malloc failed")) ; };
  1550. X
  1551. X/* ------- conversion of input character --------------------- */
  1552. X
  1553. X#define lettertocol(c)  ((c)-'a'+1)
  1554. X#define lettertolig(c)  ((c)-'1'+1)
  1555. X#define coltoletter(n)  ((n)-1+'a')
  1556. X#define ligtoletter(n)  ((n)-1+'1')
  1557. X
  1558. X
  1559. X/* ------- variables and functions --------------------------- */
  1560. Xextern char *version_string;
  1561. Xextern int configuring;
  1562. Xextern int configside;
  1563. Xextern char *in_table;
  1564. Xextern char *out_table;
  1565. Xextern char *c_roque[];
  1566. Xextern char *c_en_passant[];
  1567. Xextern char c_prise;
  1568. Xextern char *c_comments[];
  1569. Xextern int error_flag;
  1570. X
  1571. Xextern char *com_short[];
  1572. Xextern char *com_long[];
  1573. X
  1574. X/* ---------- service routines ---------- */
  1575. X
  1576. X#ifdef __STDC__
  1577. Xextern void clear_board(game *g);
  1578. Xextern game *new_board(void);
  1579. Xextern game *copy_board(game *from, game *to);
  1580. Xextern void init_board(game *tgm);
  1581. Xextern depl *new_move(void);
  1582. Xextern void init_move(depl *m);
  1583. Xextern depl *copy_move(depl *from, depl *to);
  1584. Xextern void enter_variation(void);
  1585. Xextern void exit_variation(void);
  1586. X#else
  1587. Xextern void clear_board(/*game *g*/);
  1588. Xextern game *new_board(/*void*/);
  1589. Xextern game *copy_board(/*game *from, game *to*/);
  1590. Xextern void init_board(/*game *tgm*/);
  1591. Xextern depl *new_move(/*void*/);
  1592. Xextern void init_move(/*depl *m*/);
  1593. Xextern depl *copy_move(/*depl *from, depl *to*/);
  1594. Xextern void enter_variation(/*void*/);
  1595. Xextern void exit_variation(/*void*/);
  1596. X#endif
  1597. X
  1598. X/* ------ parse and analysis routines ------ */
  1599. X
  1600. X#ifdef __STDC__
  1601. Xextern int in_board(int l, int c);
  1602. Xextern int path_free(int l1, int c1, int l2, int c2);
  1603. Xextern int check_roque(void);
  1604. Xextern int guess_piece(void);
  1605. Xextern int guess_depl(int nb, int tab[][2], int *pl1, int *pc1, int l2, int c2, int path);
  1606. Xextern int ambiguity(int frompiece, int l2, int c2);
  1607. Xextern int check_move(depl *m);
  1608. Xextern int guess_move(void);
  1609. Xextern int clear_pos(int lig, int col);
  1610. Xextern int configure(void);
  1611. Xextern int execute_move(void);
  1612. Xextern int typechar(char c);
  1613. Xextern int execute(int num, char c);
  1614. Xextern int parse_number(char *token);
  1615. Xextern int parse_text(char *text);
  1616. Xextern int parse_comment(char *com);
  1617. Xextern int parse_keyword(char *token, char *text);
  1618. Xextern int parse_roque(char *token);
  1619. Xextern int parse_move(char *token);
  1620. Xextern void init_parse(depl *m);
  1621. X#else
  1622. Xextern int in_board(/*int l, int c*/);
  1623. Xextern int path_free(/*int l1, int c1, int l2, int c2*/);
  1624. Xextern int check_roque(/*void*/);
  1625. Xextern int guess_piece(/*void*/);
  1626. Xextern int guess_depl(/*int nb, int tab[][2], int *pl1, int *pc1, int l2, int c2, int path*/);
  1627. Xextern int ambiguity(/*int frompiece, int l2, int c2*/);
  1628. Xextern int check_move(/*depl *m*/);
  1629. Xextern int guess_move(/*void*/);
  1630. Xextern int clear_pos(/*int lig, int col*/);
  1631. Xextern int configure(/*void*/);
  1632. Xextern int execute_move(/*void*/);
  1633. Xextern int typechar(/*char c*/);
  1634. Xextern int execute(/*int num, char c*/);
  1635. Xextern int parse_number(/*char *token*/);
  1636. Xextern int parse_text(/*char *text*/);
  1637. Xextern int parse_comment(/*char *com*/);
  1638. Xextern int parse_keyword(/*char *token, char *text*/);
  1639. Xextern int parse_roque(/*char *token*/);
  1640. Xextern int parse_move(/*char *token*/);
  1641. Xextern void init_parse(/*depl *m*/);
  1642. X#endif
  1643. X
  1644. X/* ------ top-level interface functions -------- */
  1645. X
  1646. X#ifdef __STDC__
  1647. Xextern int parse_options(int argc, char *argv[]);
  1648. Xextern void close_files(void);
  1649. Xextern int associe_traduction(char **table, int langage);
  1650. X
  1651. X#else
  1652. Xextern int parse_options(/*int argc, char *argv[]*/);
  1653. Xextern void close_files(/*void*/);
  1654. Xextern int associe_traduction(/*char **table, int langage*/);
  1655. X
  1656. X#endif
  1657. X
  1658. X
  1659. X#endif
  1660. END_OF_FILE
  1661. if test 5592 -ne `wc -c <'notation.h'`; then
  1662.     echo shar: \"'notation.h'\" unpacked with wrong size!
  1663. fi
  1664. # end of 'notation.h'
  1665. fi
  1666. if test -f 'print-ps' -a "${1}" != "-c" ; then 
  1667.   echo shar: Will not clobber existing file \"'print-ps'\"
  1668. else
  1669. echo shar: Extracting \"'print-ps'\" \(134 characters\)
  1670. sed "s/^X//" >'print-ps' <<'END_OF_FILE'
  1671. X#!/bin/sh
  1672. X# printer for ps files using the font chess
  1673. X# args : files to print
  1674. XCHEQFILE="./Cheq"
  1675. Xfor i
  1676. Xdo
  1677. X    cat $CHEQFILE $i | lpr
  1678. Xdone
  1679. END_OF_FILE
  1680. if test 134 -ne `wc -c <'print-ps'`; then
  1681.     echo shar: \"'print-ps'\" unpacked with wrong size!
  1682. fi
  1683. chmod +x 'print-ps'
  1684. # end of 'print-ps'
  1685. fi
  1686. if test -f 'symb.tex' -a "${1}" != "-c" ; then 
  1687.   echo shar: Will not clobber existing file \"'symb.tex'\"
  1688. else
  1689. echo shar: Extracting \"'symb.tex'\" \(3828 characters\)
  1690. sed "s/^X//" >'symb.tex' <<'END_OF_FILE'
  1691. X
  1692. X        check & \verb; +; & \verb; + ; &   + & \verb;  +; \cr
  1693. X
  1694. X        double check & \verb; ++; & \verb; ++ ; &   ++ & \verb;  ++; \cr
  1695. X
  1696. X        white stands lightly better & \verb; $wsb; & \verb; +=; &  \COMwsb & \verb; \COMwsb; \cr
  1697. X
  1698. X        black stands lightly better & \verb; $bsb; & \verb; =+; &  \COMbsb & \verb; \COMbsb; \cr
  1699. X
  1700. X        white has the upper hand & \verb; $wbe; & \verb; +_; &  \COMwbe & \verb; \COMwbe; \cr
  1701. X
  1702. X        black has the upper hand & \verb; $bbe; & \verb; _+; &  \COMbbe & \verb; \COMbbe; \cr
  1703. X
  1704. X        white has a decisive advantage & \verb; $wda; & \verb; +-; &  \COMwda & \verb; \COMwda; \cr
  1705. X
  1706. X        black has a decisive advantage & \verb; $bda; & \verb; -+; &  \COMwda & \verb; \COMwda; \cr
  1707. X
  1708. X        even & \verb; =  ; & \verb; =; &   \COMlev & \verb;  \COMlev; \cr
  1709. X
  1710. X        unclear & \verb; $ucr; & \verb; ~ ; &   \COMucr & \verb;  \COMucr; \cr
  1711. X
  1712. X        with compensation for the material & \verb; $wco; & \verb; =~ ; &   \COMwco & \verb;  \COMwco; \cr
  1713. X
  1714. X        development advantage & \verb; $dad; & \verb; (^) ; &   \COMdad & \verb;  \COMdad; \cr
  1715. X
  1716. X        greater space advantage & \verb; $spa; & \verb; () ; &   \COMspa & \verb;  \COMspa; \cr
  1717. X
  1718. X        with attack & \verb; $wta; & \verb; -> ; &   \COMwta & \verb;  \COMwta; \cr
  1719. X
  1720. X        with initiative & \verb; $win; & \verb; |^ ; &   \COMwin & \verb;  \COMwin; \cr
  1721. X
  1722. X        with counter-play & \verb; $wcp; & \verb; <-> ; &   \COMwcp & \verb;  \COMwcp; \cr
  1723. X
  1724. X        zugzwang & \verb; $zug; & \verb; (.) ; &   \COMzug & \verb;  \COMzug; \cr
  1725. X
  1726. X        mate & \verb; #; & \verb; # ; &   \# & \verb;  \#; \cr
  1727. X
  1728. X        very good move & \verb; !; & \verb; ! ; &   ! & \verb;  !; \cr
  1729. X
  1730. X        very bad move & \verb; ?; & \verb; ? ; &   ? & \verb;  ?; \cr
  1731. X
  1732. X        excellent move & \verb; !!; & \verb; !! ; &   !! & \verb;  !!; \cr
  1733. X
  1734. X        a mistake & \verb; ??; & \verb; ?? ; &   ?? & \verb;  ??; \cr
  1735. X
  1736. X        a move deserving attention & \verb; !?; & \verb; !? ; &   !? & \verb;  !?; \cr
  1737. X
  1738. X        a dubious move & \verb; ?!; & \verb; ?! ; &   ?! & \verb;  ?!; \cr
  1739. X
  1740. X        with the idea... & \verb; $wti; & \verb; /\ ; &   \COMwti & \verb;  \COMwti; \cr
  1741. X
  1742. X        only move & \verb; $olm; & \verb; [] ; &   \COMolm & \verb;  \COMolm; \cr
  1743. X
  1744. X        better is & \verb; $bei; & \verb; ^_ ; &   \COMbei & \verb;  \COMbei; \cr
  1745. X
  1746. X        file & \verb; $fil; & \verb; <=> ; &   \COMfil & \verb;  \COMfil; \cr
  1747. X
  1748. X        diagonal & \verb; $dia; & \verb; /^ ; &   \COMdia & \verb;  \COMdia; \cr
  1749. X
  1750. X        center & \verb; $cnt; & \verb; [+] ; &   \COMcnt & \verb;  \COMcnt; \cr
  1751. X
  1752. X        king's side & \verb; $kgs; & \verb; >> ; &   \COMkgs & \verb;  \COMkgs; \cr
  1753. X
  1754. X        queen's side & \verb; $qns; & \verb; << ; &   \COMqns & \verb;  \COMqns; \cr
  1755. X
  1756. X        weak point & \verb; $wkp; & \verb; >< ; &   \COMwkp & \verb;  \COMwkp; \cr
  1757. X
  1758. X        ending & \verb; $end; & \verb; _|_ ; &   \COMend & \verb;  \COMend; \cr
  1759. X
  1760. X        pair of bishops & \verb; $pob; & \verb; == ; &   \COMpob & \verb;  \COMpob; \cr
  1761. X
  1762. X        bishops of opposite colors & \verb; $opc; & \verb; =# ; &   \COMopc & \verb;  \COMopc; \cr
  1763. X
  1764. X        same coloured bishops & \verb; $scb; & \verb; ## ; &   \COMscb & \verb;  \COMscb; \cr
  1765. X
  1766. X        united pawns & \verb; $unp; & \verb; oo ; &   \COMunp & \verb;  \COMunp; \cr
  1767. X
  1768. X        separated pawns & \verb; $sep; & \verb; o..o ; &   \COMsep & \verb;  \COMsep; \cr
  1769. X
  1770. X        doubled pawns & \verb; $dop; & \verb; o/o ; &   \COMdop & \verb;  \COMdop; \cr
  1771. X
  1772. X        time & \verb; $tim; & \verb; (+) ; &   \COMtim & \verb;  \COMtim; \cr
  1773. X
  1774. X        with & \verb; $wit; & \verb; |_ ; &   \COMwit & \verb;  \COMwit; \cr
  1775. X
  1776. X        without & \verb; $wto; & \verb; _| ; &   \COMwto & \verb;  \COMwto; \cr
  1777. X
  1778. X        etc & \verb; etc; & \verb; etc ; &   {etc} & \verb;  {etc}; \cr
  1779. X
  1780. X        etc & \verb; ||; & \verb; || ; &   \COMetc & \verb;  \COMetc; \cr
  1781. X
  1782. X        see & \verb; $see; & \verb;  ; &   \COMsee & \verb;  \COMsee; \cr
  1783. X
  1784. X        en passant & \verb; ep; & \verb; ep ; &   {ep} & \verb;  {ep}; \cr
  1785. X
  1786. END_OF_FILE
  1787. if test 3828 -ne `wc -c <'symb.tex'`; then
  1788.     echo shar: \"'symb.tex'\" unpacked with wrong size!
  1789. fi
  1790. # end of 'symb.tex'
  1791. fi
  1792. if test -f 'symboles.tex' -a "${1}" != "-c" ; then 
  1793.   echo shar: Will not clobber existing file \"'symboles.tex'\"
  1794. else
  1795. echo shar: Extracting \"'symboles.tex'\" \(410 characters\)
  1796. sed "s/^X//" >'symboles.tex' <<'END_OF_FILE'
  1797. X\documentstyle[fullpage]{article}
  1798. X\pagestyle{empty}
  1799. X\begin{document}
  1800. X%\title{A Menagerie of Chess Symbols}
  1801. X%\author{Henry Thomas}
  1802. X%\date{Mars 1990}
  1803. X%\maketitle
  1804. X\input{chesssymb.tex}
  1805. X
  1806. X\font\figchess=chessfig10
  1807. X
  1808. X\begin{center}
  1809. X\begin{tabular}{|c|c|c|c|c|}\hline
  1810. XComment & Abbrev.& Abbr. & Symbol & \LaTeX\ Keyword \\ \hline \hline
  1811. X\input{symb.tex}
  1812. X & & & & \\ \hline
  1813. X\end{tabular}
  1814. X\end{center}
  1815. X
  1816. X
  1817. X\end{document}
  1818. X
  1819. END_OF_FILE
  1820. if test 410 -ne `wc -c <'symboles.tex'`; then
  1821.     echo shar: \"'symboles.tex'\" unpacked with wrong size!
  1822. fi
  1823. # end of 'symboles.tex'
  1824. fi
  1825. if test -f 'symboles.txt' -a "${1}" != "-c" ; then 
  1826.   echo shar: Will not clobber existing file \"'symboles.txt'\"
  1827. else
  1828. echo shar: Extracting \"'symboles.txt'\" \(1543 characters\)
  1829. sed "s/^X//" >'symboles.txt' <<'END_OF_FILE'
  1830. Xcomment    shorthand     english translation
  1831. X------------------------------------------------
  1832. X
  1833. X +  +          check
  1834. X
  1835. X ++  ++          double check
  1836. X
  1837. X $wsb  +=         white stands lightly better
  1838. X
  1839. X $bsb  =+         black stands lightly better
  1840. X
  1841. X $wbe  +_         white has the upper hand
  1842. X
  1843. X $bbe  _+         black has the upper hand
  1844. X
  1845. X $wda  +-         white has a decisive advantage
  1846. X
  1847. X $bda  -+         black has a decisive advantage
  1848. X
  1849. X =    =         even
  1850. X
  1851. X $ucr  ~          unclear
  1852. X
  1853. X $wco  =~          with compensation for the material
  1854. X
  1855. X $dad  (^)          development advantage
  1856. X
  1857. X $spa  ()          greater space advantage
  1858. X
  1859. X $wta  ->          with attack
  1860. X
  1861. X $win  |^          with initiative
  1862. X
  1863. X $wcp  <->          with counter-play
  1864. X
  1865. X $zug  (.)          zugzwang
  1866. X
  1867. X #  #          mate
  1868. X
  1869. X !  !          very good move
  1870. X
  1871. X ?  ?          very bad move
  1872. X
  1873. X !!  !!          excellent move
  1874. X
  1875. X ??  ??          a mistake
  1876. X
  1877. X !?  !?          a move deserving attention
  1878. X
  1879. X ?!  ?!          a dubious move
  1880. X
  1881. X $wti  /\          with the idea...
  1882. X
  1883. X $olm  []          only move
  1884. X
  1885. X $bei  ^_          better is
  1886. X
  1887. X $fil  <=>          file
  1888. X
  1889. X $dia  /^          diagonal
  1890. X
  1891. X $cnt  [+]          center
  1892. X
  1893. X $kgs  >>          king's side
  1894. X
  1895. X $qns  <<          queen's side
  1896. X
  1897. X $wkp  ><          weak point
  1898. X
  1899. X $end  _|_          ending
  1900. X
  1901. X $pob  ==          pair of bishops
  1902. X
  1903. X $opc  =#          bishops of opposite colors
  1904. X
  1905. X $scb  ##          same coloured bishops
  1906. X
  1907. X $unp  oo          united pawns
  1908. X
  1909. X $sep  o..o          separated pawns
  1910. X
  1911. X $dop  o/o          doubled pawns
  1912. X
  1913. X $tim  (+)          time
  1914. X
  1915. X $wit  |_          with
  1916. X
  1917. X $wto  _|          without
  1918. X
  1919. X etc  etc          etc
  1920. X
  1921. X ||  ||          etc
  1922. X
  1923. X $see            see
  1924. X
  1925. X ep  ep          en passant
  1926. X
  1927. END_OF_FILE
  1928. if test 1543 -ne `wc -c <'symboles.txt'`; then
  1929.     echo shar: \"'symboles.txt'\" unpacked with wrong size!
  1930. fi
  1931. # end of 'symboles.txt'
  1932. fi
  1933. echo shar: End of archive 1 \(of 4\).
  1934. cp /dev/null ark1isdone
  1935. MISSING=""
  1936. for I in 1 2 3 4 ; do
  1937.     if test ! -f ark${I}isdone ; then
  1938.     MISSING="${MISSING} ${I}"
  1939.     fi
  1940. done
  1941. if test "${MISSING}" = "" ; then
  1942.     echo You have unpacked all 4 archives.
  1943.     rm -f ark[1-9]isdone
  1944. else
  1945.     echo You still need to unpack the following archives:
  1946.     echo "        " ${MISSING}
  1947. fi
  1948. ##  End of shell archive.
  1949. exit 0
  1950. --
  1951. Henry Thomas - IRISA          - E-mail: Henry.Thomas@irisa.fr 
  1952. Campus Universitaire de Beaulieu - Phone: (+33)99 36 20 00 +549  
  1953. 35042 RENNES CEDEX FRANCE      - Fax: (+33)99 38 38 32 Telex: UNIRISA 950473F
  1954. Telex Atlas X400: /X121=842950473/@atlas.fr, Fax:/X121=200099383832/@atlas.fr
  1955. --
  1956. exit 0 # Just in case...
  1957. -- 
  1958. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1959. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1960. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1961. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1962.