home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume28 / notation / part04 < prev    next >
Encoding:
Text File  |  1992-02-13  |  39.2 KB  |  1,381 lines

  1. Newsgroups: comp.sources.misc
  2. From: hthomas@ph.tn.tudelft.nl (Henry Thomas)
  3. Subject:  v28i039:  notation - chess preprocessor v3.9, Part04/04
  4. Message-ID: <1992Feb11.204806.9238@sparky.imd.sterling.com>
  5. X-Md4-Signature: f36163333ab16295eef64e0a5a27247e
  6. Date: Tue, 11 Feb 1992 20:48:06 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: hthomas@ph.tn.tudelft.nl (Henry Thomas)
  10. Posting-number: Volume 28, Issue 39
  11. Archive-name: notation/part04
  12. Environment: UNIX
  13. Supersedes: notation: Volume20, Issue 52-55
  14.  
  15. #! /bin/sh
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  19. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  20. # Contents:  MANIFEST CHANGES Footer.ps Header.ps Makefile TODO
  21. #   algebric.ntn boudy.ntn chesssymb.tex chesstype.h convsymb.tex
  22. #   convsymb.txt drivers.h keywords.ntn lexer.h lexer.l symb.tex
  23. #   symboles.tex symboles.txt
  24. # Wrapped by kent@sparky on Tue Feb 11 14:22:46 1992
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 4 (of 4)."'
  28. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  30. else
  31.   echo shar: Extracting \"'MANIFEST'\" \(0 characters\)
  32.   sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  33. END_OF_FILE
  34.   if test 0 -ne `wc -c <'MANIFEST'`; then
  35.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  36.   fi
  37.   # end of 'MANIFEST'
  38. fi
  39. if test -f 'CHANGES' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'CHANGES'\"
  41. else
  42.   echo shar: Extracting \"'CHANGES'\" \(1507 characters\)
  43.   sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
  44. X** 10/02/92 version 3.9: make extensive use of new Chess macros
  45. X(version 1.2 mandatory) by Piet Tutelaers. The TeX output is much more
  46. Xreadable and edit-able by a human being.
  47. X
  48. X** 25/11/91 a bunch of changes: the shortened algebraic has been
  49. Ximproved, with important code redesign. The shortened algebraic is no
  50. Xreally shortened algebraic.
  51. X
  52. X** 21/11/91 Release 3.4 Corrected a bug introduced in versiopn 3.3,
  53. Xthat cause algebraic notation to indicate promotion. Also rename
  54. XHELPFILE to notation.hlp and demo files now end with .ntn instead of
  55. X.txt. 
  56. X
  57. X** 13/11/91 Release 3.3. Corrected a bug that forbidded promotion.
  58. XEnhanced errors messages. Now promotion is by default to a queen:
  59. X"h8=" is equivalent to "h8=Q".
  60. X
  61. X** 11/05/91 NEW VERSION. Many many improvements: en-passant,
  62. Xpromotion. Split the source in many differents file. Programming style
  63. Ximproved etc...
  64. X
  65. X** 24/04/91 Cleaned-up a few bugs, and added -i and -v options. 
  66. X
  67. X** 16/04/91 NEW NEW version: now handles variations and codified
  68. Xcomment, as well as specials strings as title, subtitle, score and
  69. Xcomments.
  70. X
  71. X** 12/04/91 added the following languages: czech, hungarian, polish,
  72. Xromanian, FIDE. Thank Lael.
  73. X
  74. X** 20/03/91 gnu driver has change. It is now named "xchess". The "gnu"
  75. Xname is now used for "gnuan" type files.
  76. X
  77. X** much improved latex output
  78. X
  79. X** improved internal move generation
  80. X
  81. X** added @special keyword, to directly include text in output
  82. X
  83. X** 24/01/91 The program should be ANSI-C. At last, it compiles with "gcc
  84. X-ansi -pedantic"
  85. END_OF_FILE
  86.   if test 1507 -ne `wc -c <'CHANGES'`; then
  87.     echo shar: \"'CHANGES'\" unpacked with wrong size!
  88.   fi
  89.   # end of 'CHANGES'
  90. fi
  91. if test -f 'Footer.ps' -a "${1}" != "-c" ; then 
  92.   echo shar: Will not clobber existing file \"'Footer.ps'\"
  93. else
  94.   echo shar: Extracting \"'Footer.ps'\" \(196 characters\)
  95.   sed "s/^X//" >'Footer.ps' <<'END_OF_FILE'
  96. X2 ENDPAGE
  97. X%%PageTrailer
  98. X%%PageFonts: Times-Roman Cheq 
  99. X%%PageBoundingBox: 20 20 576 756 
  100. X%%Trailer
  101. Xend %PROLOGUE
  102. X%%Pages: 1 
  103. X%%BoundingBox: 20 20 576 756 
  104. X%%DocumentFonts: Times-Roman Cheq 
  105. X%%EOF
  106. END_OF_FILE
  107.   if test 196 -ne `wc -c <'Footer.ps'`; then
  108.     echo shar: \"'Footer.ps'\" unpacked with wrong size!
  109.   fi
  110.   # end of 'Footer.ps'
  111. fi
  112. if test -f 'Header.ps' -a "${1}" != "-c" ; then 
  113.   echo shar: Will not clobber existing file \"'Header.ps'\"
  114. else
  115.   echo shar: Extracting \"'Header.ps'\" \(2180 characters\)
  116.   sed "s/^X//" >'Header.ps' <<'END_OF_FILE'
  117. X%!PS-Adobe-2.1
  118. X%%% HOW TO USE:  from Unix, "cat Cheq Example | lpr -Pprintername "
  119. X%%Title: Cheq.cheqtxtx
  120. X%%Creator: Glenn Reid and still.ps (V 1.0d release 10 edit 08)
  121. X%%BoundingBox: (atend)
  122. X%%Pages: (atend)
  123. X%%DocumentProcSets: Adobe_distill 0.95
  124. X%%EndComments
  125. X%%BeginProcSet: Adobe_distill 0.95
  126. X/PROLOGUE 30 40 add dict def
  127. X % 30 procedure entries + room for 40 cached font dictionaries
  128. X PROLOGUE begin
  129. X /clip { } def    % causes problems. remove if "clip" is needed
  130. X /bdef { bind def } bind def    /ldef { load def } bdef
  131. X /T { moveto show } bdef    /A { moveto ashow } bdef
  132. X /W { moveto widthshow } bdef    /AW { moveto awidthshow } bdef
  133. X /f /fill ldef            /R { { rlineto } repeat } bdef
  134. X /r /rlineto ldef        /L { { lineto } repeat } bdef
  135. X /m /moveto ldef        /l { moveto lineto stroke } bdef
  136. X /x { 0 rlineto } bdef        /y { 0 exch rlineto } bdef
  137. X /c /curveto ldef        /cp /closepath ldef
  138. X /s /stroke ldef        /w /setlinewidth ldef
  139. X /g /setgray ldef        /j /setlinejoin ldef
  140. X /d /setdash ldef        /F /setfont ldef
  141. X /C /setcmykcolor where { /setcmykcolor get }{ %ifelse
  142. X   { %def
  143. X     1 sub 3 { 3 index add neg dup 0 lt { pop 0 } if 3 1 roll } repeat
  144. X     setrgbcolor
  145. X   } bind
  146. X } ifelse def
  147. X /MF { findfont exch makefont setfont } bdef
  148. X /DF { findfont exch scalefont setfont currentfont def } bdef
  149. X /BEGINPAGE { pop /pagesave save def } bdef
  150. X /ENDPAGE { pop pagesave restore showpage } def
  151. X /REMAP { %def
  152. X   FontDirectory 2 index known { pop pop pop } { %ifelse
  153. X     findfont dup length dict begin
  154. X       { 1 index /FID ne {def}{pop pop} ifelse } forall
  155. X       exch dup length 0 gt { /Encoding exch def }{ pop } ifelse
  156. X     currentdict end definefont pop
  157. X   } ifelse
  158. X } bdef
  159. X /RECODE { %def
  160. X    3 -1 roll 1 index findfont /Encoding get 256 array copy exch
  161. X    0 exch { %forall
  162. X     dup type/nametype eq
  163. X       { 3 {2 index} repeat put pop 1 add }{ exch pop }ifelse
  164. X    } forall pop 3 1 roll REMAP
  165. X } bdef
  166. X end %PROLOGUE
  167. X%%EndProcSet: Adobe_distill 0.95
  168. X%%EndProlog
  169. X%%BeginSetup
  170. XPROLOGUE begin
  171. X
  172. X%%EndSetup
  173. X%%Page: 1 1
  174. X%%PageFonts: (atend)
  175. X%%PageBoundingBox: (atend)
  176. X1 BEGINPAGE
  177. X1 1 1 0 C
  178. X/F1 12 /Times-Roman DF
  179. X(output of program notation, using font Cheq \(gift of Adobe Systems\))
  180. X72 756 T
  181. X/F2 30 /Cheq DF
  182. END_OF_FILE
  183.   if test 2180 -ne `wc -c <'Header.ps'`; then
  184.     echo shar: \"'Header.ps'\" unpacked with wrong size!
  185.   fi
  186.   # end of 'Header.ps'
  187. fi
  188. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  189.   echo shar: Will not clobber existing file \"'Makefile'\"
  190. else
  191.   echo shar: Extracting \"'Makefile'\" \(3827 characters\)
  192.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  193. X# Makefile for notation program
  194. X# (C) Henry Thomas 1990
  195. X
  196. XFILES      = notation.c drivers.c lexer.c lexer.l
  197. XHEADERS       = notation.h drivers.h lexer.h chesstype.h chesssymb.def
  198. XLIBDIR     = $(HOME)/lib
  199. XLIBTEX       = $(HOME)/lib/tex
  200. XMANDIR       = $(HOME)/cygnus/man
  201. XMANSEC     = n
  202. XBINDIR       = $(HOME)/bin/$(HOSTTYPE)
  203. X
  204. XOBJECTS    = notation.o drivers.o lexer.o
  205. X
  206. XOTHERFILES = Makefile notation.hlp \
  207. X    keywords.ntn algebric.ntn shortened.ntn boudy.ntn\
  208. X    notation.doc notation.n \
  209. X    README TODO COPYING CHANGES \
  210. X    Header.ps Footer.ps \
  211. X    convsymb.txt convsymb.tex \
  212. X    symboles.txt symboles.tex chesssymb.tex symb.tex
  213. X
  214. X
  215. XSAVEFILES  = $(FILES) $(HEADERS) $(OTHERFILES)
  216. X
  217. XVERSION    = `sccs get -g notation.c`
  218. XKITNAME       = "Notation"
  219. X# version ids used for producing patches
  220. X#   -- caveat: as I started all over from 3.2, 1.0 = 3.2
  221. XOLDVER       = 1.0
  222. XNEWVER       = $(VERSION)
  223. X
  224. XSYMBKIT       = ChessSymb
  225. XSYMBFILES  = symboles.tex symb.tex chesssymb.tex
  226. X
  227. X############################################################
  228. X# you might want to define the lib path : 
  229. X#    do not forget the trailing /
  230. X# ( the library is the place where the HELPFILE, Heading, fonts etc are)
  231. X# also you can have default language for input/ouput
  232. X# define DEFAULT_INPUT_LANGUAGE and DEFAULT_OUPUT_LANGUAGE
  233. X# value can be:
  234. X#    FRENCH, ENGLISH, GERMAN, ITALIAN, SPANISH, DUTCH
  235. X# ANSI C/ TURBO C (MSDOS)
  236. X# to compile with TURBO C or ANSI C, define TURBOC
  237. XCFLAGS     = -DLIB_DIR=\"$(HOME)/lib/\" \
  238. X    -DDEFAULT_INPUT_LANGUAGE=FRENCH \
  239. X    -DDEFAULT_OUTPUT_LANGUAGE=FRENCH 
  240. XLDFLAGS    = 
  241. X
  242. X
  243. XLEX= flex
  244. X
  245. X#CC= gcc -ansi -pedantic
  246. X
  247. X############################################################
  248. X
  249. X.KEEPSTATE:
  250. X
  251. Xall: notation notation.doc symboles.txt
  252. X
  253. Xlexer.c: lexer.l chesstype.h
  254. X    $(LEX) -t lexer.l > lexer.c
  255. X
  256. Xnotation: $(OBJECTS)
  257. X    $(CC) $(CFLAGS) -o notation  $(OBJECTS) 
  258. X
  259. Xsymboles.txt:  chesssymb.def convsymb.txt
  260. X    /lib/cpp -P convsymb.txt| sed -e "s/\\\\//" |\
  261. X    sed -e 's/\"//g' | cat -s > symboles.txt
  262. X
  263. Xsymb.tex:  chesssymb.def convsymb.tex
  264. X    /lib/cpp -P convsymb.tex | sed -e 's/\\\\/\\/g' |\
  265. X    sed -e 's/\"//g' | cat -s > symb.tex
  266. X
  267. Xsymboles.dvi: symboles.tex symb.tex
  268. X    latex symboles.tex
  269. X
  270. X
  271. Xkit     : $(SAVEFILES)
  272. X    makekit -n$(KITNAME) $(LIBDIR) $(SAVEFILES) MANIFEST > MANIFEST
  273. X
  274. Xshar     : $(SAVEFILES)
  275. X    shar -o$(KITNAME).shar $(LIBDIR) $(SAVEFILES) 
  276. X    compress -f $(KITNAME).shar
  277. X
  278. Xtar     : $(SAVEFILES)
  279. X    tar -cvf - $(SAVEFILES) > $(KITNAME)$(VERSION).tar
  280. X    compress -f $(KITNAME)$(VERSION).tar
  281. X
  282. Xzoo    : $(SAVEFILES)
  283. X#    chmod +w $(KITNAME).zoo
  284. X    zoo -freshen $(KITNAME).zoo $(SAVEFILES)
  285. X    rm -f $(KITNAME).bak
  286. X#    chmod -w $(KITNAME).zoo
  287. X
  288. Xpatch    : $(SAVEFILES)
  289. X    chmod +w Notation.new/*
  290. X    rm Notation.new/*
  291. X    cp $(SAVEFILES) Notation.new
  292. X    diff -c Notation.old Notation.new > patch$(NEWVER) 
  293. X#    ( cat FTP ; shar patch$(NEWVER) ) > patch$(NEWVER).shar
  294. X
  295. Xsauve   :
  296. X    make zoo
  297. X#    chmod +w $(KITNAME).zoo
  298. X    cp $(KITNAME).zoo $(HOME)/local/sauve
  299. X#    chmod -w $(KITNAME).zoo
  300. X
  301. Xsymboles: $(SYMBFILES)
  302. X    shar -o$(SYMBKIT).shar $(SYMBFILES) 
  303. X    compress -f $(SYMBKIT).shar
  304. X    
  305. X
  306. Xfiles: notation.hlp chesssymb.def
  307. X    make notation
  308. X    strip notation
  309. X#    chmod +x print-ps
  310. X    make notation.doc 
  311. X    make symboles.txt symb.tex
  312. X
  313. Xinstall:
  314. X    make files
  315. X    cp notation $(BINDIR)
  316. X    cp chesssymb.tex notation.tex $(LIBTEX)
  317. X    cp notation.n $(MANDIR)/man$(MANSEC)/notation.$(MANSEC)
  318. X    cp notation.doc $(MANDIR)/cat$(MANSEC)/notation.$(MANSEC)
  319. X    cp notation.hlp notation.doc Header.ps Footer.ps \
  320. X        symboles.txt symboles.tex $(LIBDIR)
  321. X
  322. Xclean:
  323. X    rm -f notation $(OBJECTS) lexer.c
  324. X    rm -f $(KITNAME)*.shar[.Z] $(KITNAME)*.tar[.Z] \
  325. X        $(KITNAME)0? MANIFEST $(SYMBKIT).shar
  326. X
  327. Xnotation.doc: notation.n
  328. X    nroff -man notation.n > notation.doc
  329. X
  330. X
  331. X# DO NOT DELETE THIS LINE -- make depend depends on it.
  332. X
  333. Xdrivers.o: chesstype.h notation.h drivers.h chesssymb.def
  334. Xlexer.o: chesstype.h notation.h lexer.h chesssymb.def
  335. Xnotation.o: chesstype.h drivers.h notation.h lexer.h chesssymb.def
  336. END_OF_FILE
  337.   if test 3827 -ne `wc -c <'Makefile'`; then
  338.     echo shar: \"'Makefile'\" unpacked with wrong size!
  339.   fi
  340.   # end of 'Makefile'
  341. fi
  342. if test -f 'TODO' -a "${1}" != "-c" ; then 
  343.   echo shar: Will not clobber existing file \"'TODO'\"
  344. else
  345.   echo shar: Extracting \"'TODO'\" \(504 characters\)
  346.   sed "s/^X//" >'TODO' <<'END_OF_FILE'
  347. XThings to do:
  348. XURGENT
  349. X - fix chess/gnuan output for promotion
  350. X - rebuild latex output to fit better with Piet Tutelaers macros.
  351. X
  352. XLATER
  353. X - command line specification of chess symbols for a new language
  354. X - to have configuration file
  355. X - automatically add sufixes (.tex, ps, .asc, .roff .xboard.save ...) to
  356. Xoutput file
  357. X - add a xbord save-position format
  358. X - detect check
  359. X - a binary save format, allowing another program to interactively
  360. Xreplay the game (this should lead to a kind of "ChessBase" program ).
  361. END_OF_FILE
  362.   if test 504 -ne `wc -c <'TODO'`; then
  363.     echo shar: \"'TODO'\" unpacked with wrong size!
  364.   fi
  365.   # end of 'TODO'
  366. fi
  367. if test -f 'algebric.ntn' -a "${1}" != "-c" ; then 
  368.   echo shar: Will not clobber existing file \"'algebric.ntn'\"
  369. else
  370.   echo shar: Extracting \"'algebric.ntn'\" \(958 characters\)
  371.   sed "s/^X//" >'algebric.ntn' <<'END_OF_FILE'
  372. X
  373. X[WORLD CHESS CHAMPIONSHIP]
  374. X[GAME 13 Adjourned]
  375. X[November 24, 1990]
  376. X
  377. X[   KARPOV      KASPAROV]
  378. X 1. d2-d4      g8-f6
  379. X 2. c2-c4      g7-g6
  380. X 3. b1-c3      d7-d5
  381. X 4. c4Xd5      f6Xd5
  382. X 5. e2-e4      d5Xc3
  383. X 6. b2Xc3      f8-g7
  384. X 7. c1-e3      c7-c5
  385. X 8. d1-d2       O-O
  386. X 9. a1-c1      d8-a5
  387. X10. g1-f3      e7-e6
  388. X11. d4-d5      e6Xd5
  389. X12. e4Xd5      f8-e8
  390. X13. f1-e2      c8-f5
  391. X14.  O-O       b8-d7
  392. X15. h2-h3      d7-b6
  393. X16. g2-g4      f5-d7
  394. X17. c3-c4      a5Xd2
  395. X18. f3Xd2      b6-a4
  396. X19. e2-f3      a4-c3
  397. X20. c1Xc3      g7Xc3
  398. X21. d2-e4      e8Xe4
  399. X22. f3Xe4      a8-e8
  400. X23. e4-d3      b7-b6
  401. X24. g1-g2      f7-f5
  402. X25. g4Xf5      d7Xf5
  403. X26. d3Xf5      g6Xf5
  404. X27. f1-d1      g8-f7
  405. X28. d1-d3      c3-f6
  406. X29. d3-a3      a7-a5
  407. X30. a3-b3      f6-d8
  408. X31. b3-c3      d8-c7
  409. X32. a2-a4      f7-f6
  410. X33. g2-f1      f5-f4
  411. X34. e3-c1      f6-f5
  412. X35. c3-c2      e8-g8
  413. X36. c2-e2      c7-e5
  414. X37. c1-b2      e5-d4
  415. X38. b2Xd4      c5Xd4
  416. X39. e2-e7      d4-d3
  417. X40. f1-e1      g8-c8
  418. X41. e1-d2      c8Xc4
  419. X
  420. X
  421. X
  422. END_OF_FILE
  423.   if test 958 -ne `wc -c <'algebric.ntn'`; then
  424.     echo shar: \"'algebric.ntn'\" unpacked with wrong size!
  425.   fi
  426.   # end of 'algebric.ntn'
  427. fi
  428. if test -f 'boudy.ntn' -a "${1}" != "-c" ; then 
  429.   echo shar: Will not clobber existing file \"'boudy.ntn'\"
  430. else
  431.   echo shar: Extracting \"'boudy.ntn'\" \(864 characters\)
  432.   sed "s/^X//" >'boudy.ntn' <<'END_OF_FILE'
  433. X@title{Boudy vs Szabo, Varna 1979}
  434. X@subtitle{See Informant XXVII game 452}
  435. X@language{french}
  436. X1. e4 c5 
  437. X2 Cf3 Cc6 
  438. X3 d4 cd4
  439. X4  Cd4 Cf6
  440. X5 Cc3 d6
  441. X6. f4 a6 
  442. X7. Cc6 bc6 
  443. X8. e5 Cd7
  444. X9. ed6 ed6 
  445. X10. Df3 d5
  446. X11. Fd2 Fd6 
  447. X12. o-o-o 0-0
  448. X13. g4 Fb7 { Tb8 !? ~ } 
  449. X14. Tg1 Te8
  450. X15. g5 f5 !? {Cc5}
  451. X16. g6 h6
  452. X17. Fd3 ?! { Fh3! +_} Tf8
  453. X18. Dh3 Df6
  454. X19. Tg5 Cc5
  455. X20. Ff5 Fc8!
  456. X21. Fc8 Tac8
  457. X22. Tg4 Tb8 =~ 
  458. X23. Tf1 Ce4
  459. X24. Fe1 @showboard Tb2
  460. X25. Rb2 { Ce4 de4 26 Fc3 Fa3! 27. Ff6 Tb3 _+ $end } Fa3!
  461. X26. Ra3 {26 Ra1 Tb8 -+} Tb8 -+
  462. X27. Ce4 De7 ?? {27. ... Db2 28. Ra4 Da2 29. Da3 Dc2 30. Ra5 Tb5 
  463. X   31. Ra6 De4 /\[De8a8 -+]}
  464. X28.  Cd6! { 28. Ra4 De4 -+} Dd6
  465. X29. Ra4 c5
  466. X30. Th4 { $bei 30. Tg1 c4 31 Dc3 Dd7 32. Ra3 Dd6 33 Dd4 -+ } c4
  467. X31. Dc3 Dd7 
  468. X32. Ra3 De7 
  469. X33. Db4! +- Tb4 
  470. X34. Fb4 Dh4
  471. X35. Te1 Dd8 [] 
  472. X36. c3! a5
  473. X37. Fc5 || 
  474. X
  475. X@score{White won} [ somewhat luckily in the end at move 75.]
  476. X
  477. END_OF_FILE
  478.   if test 864 -ne `wc -c <'boudy.ntn'`; then
  479.     echo shar: \"'boudy.ntn'\" unpacked with wrong size!
  480.   fi
  481.   # end of 'boudy.ntn'
  482. fi
  483. if test -f 'chesssymb.tex' -a "${1}" != "-c" ; then 
  484.   echo shar: Will not clobber existing file \"'chesssymb.tex'\"
  485. else
  486.   echo shar: Extracting \"'chesssymb.tex'\" \(3734 characters\)
  487.   sed "s/^X//" >'chesssymb.tex' <<'END_OF_FILE'
  488. X% next definition we take from LaTeX
  489. X\def\mbox#1{\leavevmode\hbox{#1}}
  490. X
  491. X%
  492. X% Next part will be added to chess.sty version 1.2
  493. X%
  494. X
  495. X% And now we define most symbols that are used in `\v{S}ahovski Informator'
  496. X% (Chess Informant). For a complete list see Informant#51 (1991) pp 10-12.
  497. X% If you add symbols realize that the macros should be usable by plain TeX
  498. X% and LaTeX and that the (La)TeX names should be suggestive and clear!
  499. X% Thanks go to John Saba (saba@ccit.arizona.edu) and Henry Thomas 
  500. X% (hthomas@irisa.fr) for their help in defining next symbols.
  501. X\font\symbolten=cmsy10 \font\smrm=cmr6 \font\symbolsix=cmsy6
  502. X\def\Wbetter{\mbox{\baselineskip0pt$\vcenter{\vbox{\hbox{+}\hbox{=}}}$}}
  503. X\def\Bbetter{\mbox{\baselineskip0pt
  504. X   $\vcenter{\vbox{\hbox{=}\kern-.3ex\hbox{+}}}$}}
  505. X\def\Wupperhand{\mbox{$\pm$}}
  506. X\def\Bupperhand{\mbox{$\mp$}}
  507. X\def\Wdecisive{\mbox{$+\hbox{}-$}}
  508. X\def\Bdecisive{\mbox{$-\hbox{}+$}}
  509. X\def\equal{=}
  510. X\def\unclear{\mbox{$\infty$}}
  511. X\def\compensation{\mbox{\baselineskip0pt$\vcenter{\vbox{%
  512. X   \hbox{\kern.056em\vbox{\hrule width0.89em\kern0.35ex\hrule width0.89em}}
  513. X   \kern.2ex\hbox{$\infty$}}}$}}
  514. X% next symbol should be build using METAFONT
  515. X\def\devadvantage{{\symbolten\char'015}\kern-4.8pt
  516. X   \vrule width 2.4pt height6pt depth-5.6pt
  517. X   \vrule width .4pt height8pt depth-5.6pt\kern2.4pt}
  518. X\def\moreroom{{\symbolten\char'015}}
  519. X\def\withattack{$\rightarrow$}
  520. X\def\withinit{$\uparrow$}
  521. X\def\counterplay{\hbox{\baselineskip0pt%
  522. X   $\vcenter{\vbox{\hbox{$\leftarrow$}\hbox{$\rightarrow$}}}$}}
  523. X\def\zugzwang{$\odot$}
  524. X\def\mate{\kern.4pt\mbox{%
  525. X   \vrule width2ex height1.18ex depth-1.1ex\kern-2ex
  526. X   \vrule width2ex height.52ex depth-.44ex\kern-1.381ex
  527. X   \vrule width.08ex height1.8ex depth.2ex\kern0.615ex
  528. X   \vrule width.08ex height1.8ex depth.2ex\kern0.406ex}\kern.4pt}
  529. X\def\withidea{$\triangle$}
  530. X\def\onlymove{$\Box$}
  531. X\def\betteris{\mbox{\baselineskip0pt
  532. X   $\vcenter{\vbox{\hbox{$\frown$}\kern-0.35ex\hrule width0.95em}}$}}
  533. X\def\file{$\Leftrightarrow$}
  534. X% next symbol should be build using METAFONT
  535. X\def\diagonal{$\nearrow$}
  536. X\def\Center{$\Box$\kern-.6em\raise.54ex\hbox{\smrm\char'053}}
  537. X\def\kside{$\gg$}
  538. X\def\qside{$\ll$}
  539. X\def\weakpt{$\times$}
  540. X\def\ending{$\perp$}
  541. X\def\bishoppair{\setbox0=\hbox{%
  542. X   \vrule width1.4ex height1ex depth-.92ex\kern-1.4ex
  543. X   \vrule width1.4ex height.08ex depth0pt\kern-1.4ex
  544. X   \vrule width.08ex height1ex depth0ex\kern1.24ex
  545. X   \vrule width.08ex height1ex depth0ex}%
  546. X   \kern.4pt\mbox{\copy0\kern-.6ex\raise0.56ex\box0}\kern.4pt}
  547. X\def\opposbishops{\kern.4pt\mbox{%
  548. X   \vrule width1.4ex height1ex depth-.92ex\kern-1.4ex
  549. X   \vrule width1.4ex height.08ex depth0pt\kern-1.4ex
  550. X   \vrule width.08ex height1ex depth0ex\kern1.24ex
  551. X   \vrule width.08ex height1ex depth0ex\kern-.6ex
  552. X   \vrule width1.4ex height1.56ex depth-0.56ex}\kern.4pt }
  553. X\def\samebishops{\kern.4pt\mbox{%
  554. X   \vrule width1.4ex height1ex depth0ex\kern-.6ex
  555. X   \vrule width1.4ex height1.56ex depth-0.56ex}\kern.4pt}
  556. X\def\unitedpawns{$\circ\kern-.05em\circ$}
  557. X\def\seppawns{$\circ\kern-.3em\cdot\kern-.35em\cdot\kern-.1em\circ$}
  558. X\def\doublepawns{\mbox{\baselineskip0pt
  559. X   $\vcenter{\vbox{\hbox{$\circ$}\vskip.8pt\hbox{$\circ$}}}$}}
  560. X\def\passedpawns{\mbox{\baselineskip0pt
  561. X   $\vcenter{\vbox{\hbox{\kern0.09em\symbolsix\char'042}\hbox{$\circ$}}}$}}
  562. X\def\morepawns{$>$}
  563. X\def\time{$\oplus$}
  564. X\def\novelty{{\sc N}}
  565. X\def\comment{{\sc RR}}
  566. X\def\various{{\sc R}}
  567. X\def\with{\kern.4pt\mbox{%
  568. X   \vrule width 1ex height.08ex depth0ex\kern-0.08ex
  569. X   \vrule width0.08ex height1.5ex depth0ex}\kern.4pt}
  570. X\def\without{\kern.4pt\mbox{%
  571. X   \vrule width 0.08ex height1.5ex depth0ex\kern-0.08ex
  572. X   \vrule width 1ex height.08ex depth0ex}\kern.4pt}
  573. X\def\etc{$\parallel$}
  574. X\def\see{\kern.4pt\mbox{\vrule width 1em height.54ex depth-.46ex}\kern.4pt}
  575. X
  576. END_OF_FILE
  577.   if test 3734 -ne `wc -c <'chesssymb.tex'`; then
  578.     echo shar: \"'chesssymb.tex'\" unpacked with wrong size!
  579.   fi
  580.   # end of 'chesssymb.tex'
  581. fi
  582. if test -f 'chesstype.h' -a "${1}" != "-c" ; then 
  583.   echo shar: Will not clobber existing file \"'chesstype.h'\"
  584. else
  585.   echo shar: Extracting \"'chesstype.h'\" \(3157 characters\)
  586.   sed "s/^X//" >'chesstype.h' <<'END_OF_FILE'
  587. X/*
  588. X  Notation program
  589. X  @(#)chesstype.h    3.9 (C) Henry Thomas   Release 3     Dated 12/10/91
  590. X */
  591. X
  592. X/* types definition */
  593. X#ifndef _HEADERS_TYPES
  594. X#define _HEADERS_TYPES
  595. X
  596. X#define FALSE 0
  597. X#define TRUE  1
  598. X
  599. X#ifndef NULL
  600. X#define NULL    ((char *) 0)
  601. X#endif
  602. X
  603. X#define MAX(a,b)  ((a)>(b)?(a):(b))
  604. X#define MIN(a,b)  ((a)<(b)?(a):(b))
  605. X#define ABS(a)      ((a)>=0?(a):(-(a)))
  606. X#define SIGN(a)   ((a)>=0?(1):-1)
  607. X
  608. X#define DUMMYCHAR '$'
  609. X#define MAXTOKLEN 1024
  610. X
  611. X
  612. X/* max number of move for displaying board */
  613. X#define NB_MOVE_TO_DISP 128
  614. X
  615. X/* debugging help */
  616. X#ifdef DEBUG
  617. X#define MESSAGE(A) (void) fprintf A
  618. X#define ACTION(A)  A
  619. X#else
  620. X#define MESSAGE(A)
  621. X#define ACTION(A)
  622. X#endif
  623. X
  624. X/* output move format */
  625. X
  626. X#define ALGEBRAIC 0
  627. X#define SHORTENED 1
  628. X
  629. X/* text type */
  630. X#define T_TEXT        1
  631. X#define T_COMMENT    2
  632. X#define T_TITLE        3
  633. X#define T_SUBTITLE    4
  634. X#define T_SCORE        5
  635. X
  636. X/* -------------------------------------------- */
  637. X/*              chess data structures           */
  638. X/* -------------------------------------------- */
  639. X
  640. X#define NUMPIECES 7
  641. X
  642. X#define KING   1
  643. X#define QUEEN  2
  644. X#define ROOK   3
  645. X#define BISHOP 4
  646. X#define KNIGHT 5
  647. X#define PAWN   6
  648. X
  649. X#define VOID  0
  650. X#define WHITE 1
  651. X#define BLACK -1
  652. X
  653. X/* board and move representation */
  654. X/* board size */
  655. X#define SIZE 10 
  656. X
  657. X/* ---- structure to represent the game ---- */
  658. Xtypedef struct {
  659. X
  660. X  /* board definition */
  661. X  int board[SIZE][SIZE];
  662. X  int color[SIZE][SIZE];
  663. X
  664. X} game ;
  665. X/* ---- end of structure ---- */
  666. X
  667. X#define GULL (game *) 0
  668. X
  669. X/* french(roque) == english(castling) */
  670. X
  671. X#define MOVE        1      /* un mouvement        */
  672. X#define PRISE        2          /* une prise           */
  673. X#define GRANDROQUE    3     /* grand roque         */
  674. X#define PETITROQUE    4     /* petit roque         */
  675. X#define EN_PASSANT    5    /* prise en passant    */
  676. X#define PROMOTION      6    /* promotion           */
  677. X#define PROM_ET_PRISE    7    /* promotion + capture */
  678. X
  679. X#define SHORT_COMMENT_LEN 4
  680. X
  681. X/* structure used to describe the current move */
  682. Xstruct deplace {
  683. X  /* system zone */
  684. X  int uid ;             /* node id */
  685. X
  686. X  /* links used to chain moves   */
  687. X  struct deplace * next ; /* next move     */
  688. X  struct deplace * prev ; /* previous move */
  689. X  struct deplace * sub  ; /* variation     */
  690. X
  691. X  /* user zone */
  692. X  int move ;        /* number of the move */
  693. X  int whiteturn ;     /* boolean to tell if white's turn */
  694. X
  695. X  int type;        /* type of move: MOVE, PRISE, etc..   */
  696. X  int piece;        /* type of the piece */
  697. X
  698. X  int fromcol, fromlig;    /* from position */
  699. X  int tocol, tolig ;    /* destination   */
  700. X
  701. X  int prise;        /* captured piece */
  702. X  int promotion;        /* name of the pice the pawn is promoted to */
  703. X
  704. X  int is_check ;    /* if does the move provides check ?*/
  705. X
  706. X  char comment[SHORT_COMMENT_LEN];    /* short text comment */
  707. X  char * text ;         /* long text comment */
  708. X
  709. X
  710. X} ;
  711. Xtypedef struct deplace depl ;
  712. X
  713. X#define MULL (depl *) 0
  714. X
  715. X#define CURCOLOR(M) (((M)->whiteturn)?(WHITE):(BLACK))
  716. X#define OPPCOLOR(M) (((M)->whiteturn)?(BLACK):(WHITE))
  717. X
  718. X
  719. X/* structure used to hold a complete play 
  720. X   this structure is
  721. X   - an initial board 
  722. X   - a chain of moves
  723. X   moves are applied to the board, and coan also be undone
  724. X   */
  725. Xtypedef struct {
  726. X  game * initial;
  727. X  depl * chain ;
  728. X} play ;
  729. X
  730. X
  731. X/* end headers */
  732. X#endif
  733. END_OF_FILE
  734.   if test 3157 -ne `wc -c <'chesstype.h'`; then
  735.     echo shar: \"'chesstype.h'\" unpacked with wrong size!
  736.   fi
  737.   # end of 'chesstype.h'
  738. fi
  739. if test -f 'convsymb.tex' -a "${1}" != "-c" ; then 
  740.   echo shar: Will not clobber existing file \"'convsymb.tex'\"
  741. else
  742.   echo shar: Extracting \"'convsymb.tex'\" \(149 characters\)
  743.   sed "s/^X//" >'convsymb.tex' <<'END_OF_FILE'
  744. X#define CHESSSYMB(LET,LASC,SASC,TEX,PS,ENG,FRA)\
  745. XENG & \verb;LASC; & \verb;SASC;    & TEX &  \verb;TEX; \cr  
  746. X#include "chesssymb.def"
  747. X#undef CHESSSYMB
  748. END_OF_FILE
  749.   if test 149 -ne `wc -c <'convsymb.tex'`; then
  750.     echo shar: \"'convsymb.tex'\" unpacked with wrong size!
  751.   fi
  752.   # end of 'convsymb.tex'
  753. fi
  754. if test -f 'convsymb.txt' -a "${1}" != "-c" ; then 
  755.   echo shar: Will not clobber existing file \"'convsymb.txt'\"
  756. else
  757.   echo shar: Extracting \"'convsymb.txt'\" \(195 characters\)
  758.   sed "s/^X//" >'convsymb.txt' <<'END_OF_FILE'
  759. Xcomment    shorthand     english translation
  760. X------------------------------------------------
  761. X#define CHESSSYMB(LET,LASC,SASC,TEX,PS,ENG,FRA)\
  762. XLASC        SASC        ENG
  763. X#include "chesssymb.def"
  764. X#undef CHESSSYMB
  765. END_OF_FILE
  766.   if test 195 -ne `wc -c <'convsymb.txt'`; then
  767.     echo shar: \"'convsymb.txt'\" unpacked with wrong size!
  768.   fi
  769.   # end of 'convsymb.txt'
  770. fi
  771. if test -f 'drivers.h' -a "${1}" != "-c" ; then 
  772.   echo shar: Will not clobber existing file \"'drivers.h'\"
  773. else
  774.   echo shar: Extracting \"'drivers.h'\" \(2473 characters\)
  775.   sed "s/^X//" >'drivers.h' <<'END_OF_FILE'
  776. X/*
  777. X  Notation program
  778. X  @(#)drivers.h    3.9 (C) Henry Thomas   Release 3     Dated 12/10/91
  779. X */
  780. X/* headers for output drivers */
  781. X#ifndef _HEADERS_DRIVERS
  782. X#define HEADERS_DRIVERS
  783. X
  784. X
  785. X#define D_ASCII  0
  786. X#define D_POST   1
  787. X#define D_TEX    2
  788. X#define D_ROFF   3
  789. X#define D_XCHESS 4
  790. X#define D_GNU    5
  791. X
  792. X#define NB_DRIVER 6
  793. X
  794. X/* variation convention */
  795. X#define VARIATION_IN 0
  796. X#define VARIATION_OUT 1
  797. X
  798. X
  799. X#define PS_HEADER  "Header.ps"
  800. X#define PS_FOOTER  "Footer.ps"
  801. X#define TEX_HEADER "Header.tex"
  802. X
  803. X
  804. X/* output buffers */
  805. X#define TAMPON 256
  806. X
  807. Xtypedef struct {
  808. X
  809. X  /* type of driver */
  810. X  int type ;
  811. X
  812. X  /* output_file */
  813. X  FILE *outfile ;
  814. X  /* these  booleans control the output format */
  815. X  int print_move    ;  /* move numbering */
  816. X  int print_piece   ;  /* print piece name */
  817. X  int print_pawn    ; /* print the PAWN name */
  818. X  int roque_alg     ; /*  roque in algebraic form Ke1g1 or O-O */
  819. X  int print_liaison ; /* print the - or x in move output */
  820. X  int only_board ;
  821. X  int variation     ; /* variation level */
  822. X  int print_headers ; /* include the header/footer file */
  823. X
  824. X  /* boolean to print the coordinates in ascii output of board */
  825. X  int coordinates   ;
  826. X  int output_move_format ;
  827. X
  828. X  char *out_table;    /* translation table */
  829. X
  830. X  /* procedures */
  831. X  void (*out_init)() ;
  832. X  void (*out_move)() ;
  833. X  void (*out_variation)() ;
  834. X  void (*out_text)() ;
  835. X  void (*out_board)() ;
  836. X  void (*out_end)() ;
  837. X
  838. X  /* temp vars  used by move buffering */
  839. X
  840. X  int iswhiteturn ; /*= FALSE */
  841. X  int interrupt ; /*= FALSE */
  842. X
  843. X  char move_buffer[TAMPON]  /*= ""*/ ;
  844. X  char white_buffer[TAMPON] /*= ""*/ ;
  845. X  char black_buffer[TAMPON] /*= ""*/ ;
  846. X
  847. X
  848. X} format ;
  849. X
  850. X
  851. X/* fonctions ----------------- */
  852. X
  853. X#ifdef __STDC__
  854. X
  855. Xextern void output_init(format *dr);
  856. Xextern void output_move(format *dr, depl *d);
  857. Xextern void output_variation(format *dr, int inout);
  858. Xextern void output_text(format *dr, int type, char *string, int code);
  859. Xextern void output_board(format *dr, game *g);
  860. Xextern void output_end(format *dr);
  861. X
  862. Xextern format *new_driver(void);
  863. Xextern void init_driver(format *dr, int driver);
  864. X
  865. X#else
  866. X
  867. Xextern void output_init(/*format *dr*/);
  868. Xextern void output_move(/*format *dr, depl *d*/);
  869. Xextern void output_variation(/*format *dr, int inout*/);
  870. Xextern void output_text(/*format *dr, int type, char *string, int code*/);
  871. Xextern void output_board(/*format *dr, game *g*/);
  872. Xextern void output_end(/*format *dr*/);
  873. X
  874. Xextern format *new_driver(/*void*/);
  875. Xextern void init_driver(/*format *dr, int driver*/);
  876. X#endif
  877. X
  878. X#endif
  879. END_OF_FILE
  880.   if test 2473 -ne `wc -c <'drivers.h'`; then
  881.     echo shar: \"'drivers.h'\" unpacked with wrong size!
  882.   fi
  883.   # end of 'drivers.h'
  884. fi
  885. if test -f 'keywords.ntn' -a "${1}" != "-c" ; then 
  886.   echo shar: Will not clobber existing file \"'keywords.ntn'\"
  887. else
  888.   echo shar: Extracting \"'keywords.ntn'\" \(256 characters\)
  889.   sed "s/^X//" >'keywords.ntn' <<'END_OF_FILE'
  890. X[Example of keywords use]
  891. X[absolutely non-sense game]
  892. Xe2-e4 c7c6
  893. X@showboard
  894. X@clearboard
  895. X@showboard
  896. X@configwhite
  897. X d4    Nf6
  898. X Nc3   @showboard d5
  899. X@configblack
  900. X Kg8
  901. X@startplay
  902. X@whitesmove
  903. XNc3-b1
  904. X@showboard
  905. X@blacksmove
  906. XRg8-g7 @showboard d5-d6
  907. XRg7-f6
  908. X
  909. X@null
  910. X
  911. X
  912. X
  913. END_OF_FILE
  914.   if test 256 -ne `wc -c <'keywords.ntn'`; then
  915.     echo shar: \"'keywords.ntn'\" unpacked with wrong size!
  916.   fi
  917.   # end of 'keywords.ntn'
  918. fi
  919. if test -f 'lexer.h' -a "${1}" != "-c" ; then 
  920.   echo shar: Will not clobber existing file \"'lexer.h'\"
  921. else
  922.   echo shar: Extracting \"'lexer.h'\" \(312 characters\)
  923.   sed "s/^X//" >'lexer.h' <<'END_OF_FILE'
  924. X/*
  925. X  Notation program
  926. X  @(#)lexer.h    3.9 (C) Henry Thomas   Release 3     Dated 12/10/91
  927. X */
  928. X#ifndef _HEADER_LEXER
  929. X#define _HEADER_LEXER
  930. X
  931. Xextern int column;
  932. Xextern int lineno;
  933. X
  934. Xextern FILE * yyin;
  935. Xextern FILE * yyout;
  936. X
  937. X#ifdef __STDC__
  938. Xextern int yylex(/*void*/);
  939. X#else
  940. Xextern int yylex(/*void*/);
  941. X#endif
  942. X
  943. X
  944. X#endif
  945. END_OF_FILE
  946.   if test 312 -ne `wc -c <'lexer.h'`; then
  947.     echo shar: \"'lexer.h'\" unpacked with wrong size!
  948.   fi
  949.   # end of 'lexer.h'
  950. fi
  951. if test -f 'lexer.l' -a "${1}" != "-c" ; then 
  952.   echo shar: Will not clobber existing file \"'lexer.l'\"
  953. else
  954.   echo shar: Extracting \"'lexer.l'\" \(3990 characters\)
  955.   sed "s/^X//" >'lexer.l' <<'END_OF_FILE'
  956. X/* DO NOT REMOVE THIS LINE                      */
  957. X/*                                              */
  958. X/* Notation program                             */
  959. X/* @(#)lexer.l    3.9 (C) Henry Thomas   Release 3     Dated 12/10/91 */
  960. X/*                                              */
  961. X%{
  962. X#include <stdio.h>
  963. X
  964. X#include "chesstype.h"
  965. X#include"notation.h"
  966. X
  967. X#define NCURLINE 1024
  968. Xchar curline [NCURLINE] ;
  969. X
  970. X#define LARGE_BUF 4096
  971. Xstatic char commbuf[LARGE_BUF];
  972. X
  973. Xint column = 0;
  974. Xint lineno = 1;
  975. X
  976. X#ifdef __STDC__
  977. Xextern void count(void);
  978. Xextern char * comment(int closing);
  979. X#else
  980. Xextern void count();
  981. Xextern char * comment();
  982. X#endif
  983. X
  984. X%}
  985. X
  986. XLEXSHORT [-+!?#]
  987. XLEXLONG  [-+=/\\\^\&\*\~<>_|#]
  988. X
  989. X%%
  990. X[Oo0]\-?[Oo0](\-?[Oo0])? { /* roque */ ; parse_roque(yytext); }
  991. X[0-9]+[\.]?            { /* move number */ parse_number(yytext); }
  992. X[A-Z]?([a-z]([1-8])?)?[-xX]?[a-z][1-8]=?[A-Z]?  { /* move */  
  993. X  (void) parse_move(yytext);
  994. X  /*; fprintf(stderr,"%s, ",yytext);*/ 
  995. X}
  996. X
  997. X
  998. X{LEXLONG}{LEXLONG}{LEXLONG}     { /* comment */ ; 
  999. X                parse_comment(yytext); }
  1000. X{LEXLONG}{LEXLONG}      { /* comment */ ; 
  1001. X                   parse_comment(yytext); }
  1002. X{LEXSHORT}{LEXSHORT}    { /* comment */ ; 
  1003. X                     parse_comment(yytext); }
  1004. X{LEXLONG}               { /* comment */ ; 
  1005. X               parse_comment(yytext); }
  1006. X{LEXSHORT}              { /* comment */ ; parse_comment(yytext); }
  1007. X"\(\.\)"                { /* comment */ ; parse_comment(yytext); }
  1008. X"\(\*\)"                { /* comment */ ; parse_comment(yytext); }
  1009. X"\(\^\)"                { /* comment */ ; parse_comment(yytext); }
  1010. X"\[\+\]"                { /* comment */ ; parse_comment(yytext); }
  1011. X"\(\)"                  { /* comment */ ; parse_comment(yytext); }
  1012. X"\[\]"                  { /* comment */ ; parse_comment(yytext); }
  1013. X"o\.\.o"                { /* comment */ ; parse_comment(yytext); }
  1014. X"oo"                    { /* comment */ ; parse_comment(yytext); }
  1015. X"o/o"                   { /* comment */ ; parse_comment(yytext); }
  1016. X"@\^"                   { /* comment */ ; parse_comment(yytext); }
  1017. X"etc"                   { /* comment */ ; parse_comment("etc"); }
  1018. X"ep"|"e\.p\."           { /* comment */ ; parse_comment("ep"); }
  1019. X\$[a-z][a-z][a-z]       { /* game comment */ ; parse_comment(yytext); }
  1020. X@[a-z]+\{        { /* keyword with arg */ 
  1021. X  yytext[yyleng -1] = '\0' ;
  1022. X  parse_keyword(yytext, comment('}'));
  1023. X}
  1024. X@[a-z]+            { /* keyword without arg */ 
  1025. X  parse_keyword(yytext,NULL); }
  1026. X"\["            { parse_text(comment(']')); }
  1027. X"\("            { parse_text(comment(')')); }
  1028. X"\{"                    { /* enter variation */ ; enter_variation(); }
  1029. X"\}"            { /* close variation */ ; exit_variation(); }
  1030. X[\,;\.]            { /* skip , ; */ ; }
  1031. X[ \t\v\n\f]             { /* skip blanks */; }
  1032. X.                      { /* ignore bad characters */ (void) fprintf(stderr,"I don't understand: %s\n",yytext);}
  1033. X%%
  1034. X
  1035. X#ifdef FLEX_SCANNER
  1036. X#undef yywrap
  1037. X#endif
  1038. X#ifdef __STDC__
  1039. Xint yywrap(void)
  1040. X#else
  1041. Xint yywrap()
  1042. X#endif
  1043. X{
  1044. X        return(1);
  1045. X}
  1046. X
  1047. X
  1048. X/* this procedure store comments in the text array commbuf
  1049. X   Escape char are allowed for putting the end-of-comment symbol
  1050. X   in the buffer
  1051. X   */
  1052. X#ifdef __STDC__
  1053. Xstatic char * comment(int closing)
  1054. X#else
  1055. Xstatic char * comment(closing)
  1056. X     char closing;
  1057. X#endif
  1058. X{
  1059. X  register char c;
  1060. X  register int i=0;
  1061. X
  1062. X  while ( ((c = input()) != closing)  && (c != 0) && (c != EOF)) {
  1063. X    commbuf[i] = c;
  1064. X    if (i <LARGE_BUF) i++ ;
  1065. X    
  1066. X    if (c == '\\') {
  1067. X      c = input() ;
  1068. X      if (c == closing)
  1069. X    commbuf[i-1] = c;
  1070. X      else
  1071. X    unput(c);
  1072. X    }
  1073. X  }
  1074. X  commbuf[i] = '\0' ;
  1075. X  return(commbuf);
  1076. X}
  1077. X
  1078. X#ifdef __STDC__
  1079. Xstatic void count(void)
  1080. X#else
  1081. Xstatic void count()
  1082. X#endif
  1083. X{
  1084. X  register int i;
  1085. X  register int k;
  1086. X
  1087. X  for (i = 0; yytext[i] != '\0'; i++) {
  1088. X    if (yytext[i] == '\n') {
  1089. X      column = 0;
  1090. X      for (k = 0 ; k< NCURLINE; k++) /*PANDORE*/
  1091. X        curline[k] = ' '; /*PANDORE*/
  1092. X      lineno++;
  1093. X    }
  1094. X    else if (yytext[i] == '\t') {
  1095. X      column += 8 - (column % 8);
  1096. X      curline[column] = yytext[i];
  1097. X    } else {
  1098. X      column++;
  1099. X      curline[column] = yytext[i];
  1100. X    }
  1101. X    curline[column+1]= '\0' ;
  1102. X  }
  1103. X  /*ECHO;*/
  1104. X}
  1105. END_OF_FILE
  1106.   if test 3990 -ne `wc -c <'lexer.l'`; then
  1107.     echo shar: \"'lexer.l'\" unpacked with wrong size!
  1108.   fi
  1109.   # end of 'lexer.l'
  1110. fi
  1111. if test -f 'symb.tex' -a "${1}" != "-c" ; then 
  1112.   echo shar: Will not clobber existing file \"'symb.tex'\"
  1113. else
  1114.   echo shar: Extracting \"'symb.tex'\" \(4157 characters\)
  1115.   sed "s/^X//" >'symb.tex' <<'END_OF_FILE'
  1116. X
  1117. X        check & \verb; +; & \verb; + ; &   + & \verb;  +; \cr
  1118. X
  1119. X        double check & \verb; ++; & \verb; ++ ; &   ++ & \verb;  ++; \cr
  1120. X
  1121. X        white stands lightly better & \verb; $wsb; & \verb; +=; &  \wbetter & \verb; \wbetter; \cr
  1122. X
  1123. X        black stands lightly better & \verb; $bsb; & \verb; =+; &  \bbetter & \verb; \bbetter; \cr
  1124. X
  1125. X        white has the upper hand & \verb; $wbe; & \verb; +_; &  \wupperhand & \verb; \wupperhand; \cr
  1126. X
  1127. X        black has the upper hand & \verb; $bbe; & \verb; _+; &  \bupperhand & \verb; \bupperhand; \cr
  1128. X
  1129. X        white has a decisive advantage & \verb; $wda; & \verb; +-; &  \wdecisive & \verb; \wdecisive; \cr
  1130. X
  1131. X        black has a decisive advantage & \verb; $bda; & \verb; -+; &  \bdecisive & \verb; \bdecisive; \cr
  1132. X
  1133. X        even & \verb; =  ; & \verb; =; &   \equal & \verb;  \equal; \cr
  1134. X
  1135. X        unclear & \verb; $ucr; & \verb; ~ ; &   \unclear & \verb;  \unclear; \cr
  1136. X
  1137. X        with compensation for the material & \verb; $wco; & \verb; =~ ; &   \compensation & \verb;  \compensation; \cr
  1138. X
  1139. X        development advantage & \verb; $dad; & \verb; (^) ; &   \devadvantage & \verb;  \devadvantage; \cr
  1140. X
  1141. X        greater space advantage & \verb; $spa; & \verb; () ; &   \moreroom & \verb;  \moreroom; \cr
  1142. X
  1143. X        with attack & \verb; $wta; & \verb; -> ; &   \withattack & \verb;  \withattack; \cr
  1144. X
  1145. X        with initiative & \verb; $win; & \verb; |^ ; &   \withinit & \verb;  \withinit; \cr
  1146. X
  1147. X        with counter-play & \verb; $wcp; & \verb; <-> ; &   \counterplay & \verb;  \counterplay; \cr
  1148. X
  1149. X        zugzwang & \verb; $zug; & \verb; (.) ; &   \zugzwang & \verb;  \zugzwang; \cr
  1150. X
  1151. X        mate & \verb; #; & \verb; # ; &   \mate & \verb;  \mate; \cr
  1152. X
  1153. X        very good move & \verb; !; & \verb; ! ; &   ! & \verb;  !; \cr
  1154. X
  1155. X        very bad move & \verb; ?; & \verb; ? ; &   ? & \verb;  ?; \cr
  1156. X
  1157. X        excellent move & \verb; !!; & \verb; !! ; &   !! & \verb;  !!; \cr
  1158. X
  1159. X        a mistake & \verb; ??; & \verb; ?? ; &   ?? & \verb;  ??; \cr
  1160. X
  1161. X        a move deserving attention & \verb; !?; & \verb; !? ; &   !? & \verb;  !?; \cr
  1162. X
  1163. X        a dubious move & \verb; ?!; & \verb; ?! ; &   ?! & \verb;  ?!; \cr
  1164. X
  1165. X        with the idea... & \verb; $wti; & \verb; /\ ; &   \withidea & \verb;  \withidea; \cr
  1166. X
  1167. X        only move & \verb; $olm; & \verb; [] ; &   \onlymove & \verb;  \onlymove; \cr
  1168. X
  1169. X        better is & \verb; $bei; & \verb; ^_ ; &   \betteris & \verb;  \betteris; \cr
  1170. X
  1171. X        file & \verb; $fil; & \verb; <=> ; &   \file & \verb;  \file; \cr
  1172. X
  1173. X        diagonal & \verb; $dia; & \verb; /^ ; &   \diagonal & \verb;  \diagonal; \cr
  1174. X
  1175. X        center & \verb; $cnt; & \verb; [+] ; &   \centre & \verb;  \centre; \cr
  1176. X
  1177. X        king's side & \verb; $kgs; & \verb; >> ; &   \kside & \verb;  \kside; \cr
  1178. X
  1179. X        queen's side & \verb; $qns; & \verb; << ; &   \qside & \verb;  \qside; \cr
  1180. X
  1181. X        weak point & \verb; $wkp; & \verb; >< ; &   \weakpt & \verb;  \weakpt; \cr
  1182. X
  1183. X        ending & \verb; $end; & \verb; _|_ ; &   \ending & \verb;  \ending; \cr
  1184. X
  1185. X        pair of bishops & \verb; $pob; & \verb; == ; &   \bishoppair & \verb;  \bishoppair; \cr
  1186. X
  1187. X        bishops of opposite colors & \verb; $opc; & \verb; =# ; &   \opposbishops & \verb;  \opposbishops; \cr
  1188. X
  1189. X        same coloured bishops & \verb; $scb; & \verb; ## ; &   \samebishops & \verb;  \samebishops; \cr
  1190. X
  1191. X        united pawns & \verb; $unp; & \verb; oo ; &   \unitedpawns & \verb;  \unitedpawns; \cr
  1192. X
  1193. X        separated pawns & \verb; $sep; & \verb; o..o ; &   \seppawns & \verb;  \seppawns; \cr
  1194. X
  1195. X        doubled pawns & \verb; $dop; & \verb; o/o ; &   \doublepawns & \verb;  \doublepawns; \cr
  1196. X
  1197. X        time & \verb; $tim; & \verb; (+) ; &   \timelimit & \verb;  \timelimit; \cr
  1198. X
  1199. X        novelty & \verb; $nov; & \verb; N ; &   \novelty & \verb;  \novelty; \cr
  1200. X
  1201. X        editorial comment & \verb; $com; & \verb; RR ; &   \comment & \verb;  \comment; \cr
  1202. X
  1203. X        various moves & \verb; $var; & \verb; R ; &   \various & \verb;  \various; \cr
  1204. X
  1205. X        without & \verb; $wto; & \verb; _| ; &   \without & \verb;  \without; \cr
  1206. X
  1207. X        etc & \verb; etc; & \verb; etc ; &   {etc} & \verb;  {etc}; \cr
  1208. X
  1209. X        etc & \verb; ||; & \verb; || ; &   \etc & \verb;  \etc; \cr
  1210. X
  1211. X        see & \verb; $see; & \verb;  ; &   \see & \verb;  \see; \cr
  1212. X
  1213. X        en passant & \verb; ep; & \verb; ep ; &   {ep} & \verb;  {ep}; \cr
  1214. X
  1215. END_OF_FILE
  1216.   if test 4157 -ne `wc -c <'symb.tex'`; then
  1217.     echo shar: \"'symb.tex'\" unpacked with wrong size!
  1218.   fi
  1219.   # end of 'symb.tex'
  1220. fi
  1221. if test -f 'symboles.tex' -a "${1}" != "-c" ; then 
  1222.   echo shar: Will not clobber existing file \"'symboles.tex'\"
  1223. else
  1224.   echo shar: Extracting \"'symboles.tex'\" \(396 characters\)
  1225.   sed "s/^X//" >'symboles.tex' <<'END_OF_FILE'
  1226. X\documentstyle[fullpage,chess]{article}
  1227. X\pagestyle{empty}
  1228. X\begin{document}
  1229. X%\title{A Menagerie of Chess Symbols}
  1230. X%\author{Henry Thomas}
  1231. X%\date{Mars 1990}
  1232. X%\maketitle
  1233. X
  1234. X\begin{nochess}
  1235. X\begin{center}
  1236. X\begin{tabular}{|c|c|c|c|l|}\hline
  1237. XComment & Abbrev.& Abbr. & Symbol & \LaTeX\ Keyword \\ \hline \hline
  1238. X\input{symb.tex}
  1239. X & & & & \\ \hline
  1240. X\end{tabular}
  1241. X\end{center}
  1242. X\end{nochess}
  1243. X
  1244. X\end{document}
  1245. X
  1246. END_OF_FILE
  1247.   if test 396 -ne `wc -c <'symboles.tex'`; then
  1248.     echo shar: \"'symboles.tex'\" unpacked with wrong size!
  1249.   fi
  1250.   # end of 'symboles.tex'
  1251. fi
  1252. if test -f 'symboles.txt' -a "${1}" != "-c" ; then 
  1253.   echo shar: Will not clobber existing file \"'symboles.txt'\"
  1254. else
  1255.   echo shar: Extracting \"'symboles.txt'\" \(1610 characters\)
  1256.   sed "s/^X//" >'symboles.txt' <<'END_OF_FILE'
  1257. Xcomment    shorthand     english translation
  1258. X------------------------------------------------
  1259. X
  1260. X +  +          check
  1261. X
  1262. X ++  ++          double check
  1263. X
  1264. X $wsb  +=         white stands lightly better
  1265. X
  1266. X $bsb  =+         black stands lightly better
  1267. X
  1268. X $wbe  +_         white has the upper hand
  1269. X
  1270. X $bbe  _+         black has the upper hand
  1271. X
  1272. X $wda  +-         white has a decisive advantage
  1273. X
  1274. X $bda  -+         black has a decisive advantage
  1275. X
  1276. X =    =         even
  1277. X
  1278. X $ucr  ~          unclear
  1279. X
  1280. X $wco  =~          with compensation for the material
  1281. X
  1282. X $dad  (^)          development advantage
  1283. X
  1284. X $spa  ()          greater space advantage
  1285. X
  1286. X $wta  ->          with attack
  1287. X
  1288. X $win  |^          with initiative
  1289. X
  1290. X $wcp  <->          with counter-play
  1291. X
  1292. X $zug  (.)          zugzwang
  1293. X
  1294. X #  #          mate
  1295. X
  1296. X !  !          very good move
  1297. X
  1298. X ?  ?          very bad move
  1299. X
  1300. X !!  !!          excellent move
  1301. X
  1302. X ??  ??          a mistake
  1303. X
  1304. X !?  !?          a move deserving attention
  1305. X
  1306. X ?!  ?!          a dubious move
  1307. X
  1308. X $wti  /\          with the idea...
  1309. X
  1310. X $olm  []          only move
  1311. X
  1312. X $bei  ^_          better is
  1313. X
  1314. X $fil  <=>          file
  1315. X
  1316. X $dia  /^          diagonal
  1317. X
  1318. X $cnt  [+]          center
  1319. X
  1320. X $kgs  >>          king's side
  1321. X
  1322. X $qns  <<          queen's side
  1323. X
  1324. X $wkp  ><          weak point
  1325. X
  1326. X $end  _|_          ending
  1327. X
  1328. X $pob  ==          pair of bishops
  1329. X
  1330. X $opc  =#          bishops of opposite colors
  1331. X
  1332. X $scb  ##          same coloured bishops
  1333. X
  1334. X $unp  oo          united pawns
  1335. X
  1336. X $sep  o..o          separated pawns
  1337. X
  1338. X $dop  o/o          doubled pawns
  1339. X
  1340. X $tim  (+)          time
  1341. X
  1342. X $nov  N          novelty
  1343. X
  1344. X $com  RR          editorial comment
  1345. X
  1346. X $var  R          various moves
  1347. X
  1348. X $wto  _|          without
  1349. X
  1350. X etc  etc          etc
  1351. X
  1352. X ||  ||          etc
  1353. X
  1354. X $see            see
  1355. X
  1356. X ep  ep          en passant
  1357. X
  1358. END_OF_FILE
  1359.   if test 1610 -ne `wc -c <'symboles.txt'`; then
  1360.     echo shar: \"'symboles.txt'\" unpacked with wrong size!
  1361.   fi
  1362.   # end of 'symboles.txt'
  1363. fi
  1364. echo shar: End of archive 4 \(of 4\).
  1365. cp /dev/null ark4isdone
  1366. MISSING=""
  1367. for I in 1 2 3 4 ; do
  1368.     if test ! -f ark${I}isdone ; then
  1369.     MISSING="${MISSING} ${I}"
  1370.     fi
  1371. done
  1372. if test "${MISSING}" = "" ; then
  1373.     echo You have unpacked all 4 archives.
  1374.     rm -f ark[1-9]isdone
  1375. else
  1376.     echo You still must unpack the following archives:
  1377.     echo "        " ${MISSING}
  1378. fi
  1379. exit 0
  1380. exit 0 # Just in case...
  1381.