\RequirePackage{epic} \RequirePackage{eepic} \RequirePackage{pstricks} \RequirePackage{chess} % I can't figure out why \ensuremath is needed. Otherwise, when not % in math mode, horizontal space is created after game positions. \newif\ifgameboardspaces \gameboardspacestrue \newlength{\chomplength} \newlength{\dotsandboxeslength} \newlength{\stringsandcoinslength} \newlength{\clobberlength} \newlength{\Clobberlength} \newlength{\bridgitlength} \newlength{\domineeringlength} \newlength{\amazonslength} \setlength{\dotsandboxeslength}{.35cm} \setlength{\stringsandcoinslength}{.35cm} \setlength{\clobberlength}{.2cm} % for inline \setlength{\Clobberlength}{.5cm} % for display \setlength{\chomplength}{.5cm} \setlength{\bridgitlength}{.4cm} \setlength{\domineeringlength}{.3cm} \font\Chess=chess8 \setlength{\amazonslength}{.35cm} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % From game.sty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\buildG@me#1#2{% \setbox\z@\hbox{$#1{#2}$}% \setbox\tw@\null \ht\tw@\ht\z@ \dp\tw@\dp\z@ #1\left\{{\hskip-\nulldelimiterspace\left.% {\next}\nonscript\;% \box\tw@\right|\nonscript\;}% {#2}\right\}} \def\Game#1{\def\next{#1}\mathpalette\buildG@me} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Turn into . and into \\ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \edef\next{\the\catcode`\@} % save the old catcode \catcode`\@=11 % now @ can be part of token names \catcode`\ \active \catcode`\^^M=13% \def\@convertspaces{\catcode`\ \active\let .\catcode`\ \active\let \\}% \gdef\@restorespaces{\catcode`\ =10\restorecr}% \restorecr \catcode`\ =10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\d@tt@dline{\dottedline{.2}} \countdef\@gamecols=40 \countdef\@gamerows=41 \countdef\@gamecol=42 \countdef\@gamerow=43 \newif{\if@gamerowread} \def\@gameboardsetdims#1{\@gamecols=0 \@gamecol=0 \@gamerows=0 \@gamerowreadfalse \@@gameboardsetdims#1\end} \def\@@gameboardadvancerow{% \ifnum\@gamecols<\@gamecol \@gamecols=\@gamecol\else\fi \if@gamerowread \@gamecol=0 \advance\@gamerows by 1\fi} \def\@@gameboardsetdims#1{ \ifx#1\end \let\next=\relax \else \ifx#1\\\@@gameboardadvancerow \else\advance\@gamecol by 1\@gamerowreadtrue \fi \let\next=\@@gameboardsetdims\fi \next} \def\@gameboardprocess#1{ \psset{unit=1\unitlength} \@gamerow=\number\@gamerows \@gamecol=0 \@gamerowreadfalse \@@gameboardprocess#1\end\put(0,0){\@gameboardinsert} } \def\@gameincrementdims{ \advance\@gamerows by 1 \advance \@gamecols by 1} \def\@gamedecrementdims{ \advance\@gamerows by -1 \advance \@gamecols by -1} \def\@@gameboardprocess#1{ \ifx#1\end \let\next=\relax \else % first adjust row, col \ifx#1\\ \if@gamerowread\advance\@gamerow by -1\fi \@gamecol=0 \else \@gamerowreadtrue\advance\@gamecol by 1 \fi % determine if an X or O should be drawn \@gamedisplaychar{#1} % continue looping \let\next=\@@gameboardprocess\fi \next} \newlength{\@halfgameboardlength} \def\@gameboardmarks{} \def\SetMarks#1{\def\@gameboardmarks{#1}} \def\settodepth#1#2{\setbox\tempbox\hbox{#2}#1\dp\tempbox\relax} \def\settoheight#1#2{\setbox\tempbox\hbox{#2}#1\ht\tempbox\relax} \def\@gameboardreset{\gdef\@gameboardinsert{}} \@gameboardreset \def\gameboardinsert#1{\def\@gameboardinsert{#1}} \def\g@meboard{\catcode`\^=11\ifgameboardspaces\@convertspaces\fi\@@@gameboard} \long\def\@@@gameboard#1{ \@restorespaces\catcode`\^=7 \ensuremath\@gameboardsetdims{#1} \setlength{\@halfgameboardlength}{.5\unitlength} \raisebox{.5ex}{\raisebox{-\number\@gamerows\@halfgameboardlength}% {\@gameboard{#1}}} \@gameboardreset } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\clobberO{\circle{\clobberdiam}} \def\clobberX{\circle*{\clobberdiam}} \def\clobberdiam{.8} \def\@clobberbase{ \def\@gamedisplaychar##1{% this comment required for eepic \ifx##1X \put(-.5,-.5){\put(\number\@gamecol,\number\@gamerow){\clobberX}} \fi \ifx##1O \put(-.5,-.5){\put(\number\@gamecol,\number\@gamerow){\clobberO}} \fi } } \def\clobber{ \@clobberbase \def\@gameboard##1{% \begin{picture}(\number\@gamecols,\number\@gamerows) \uppercase{\@gameboardprocess{##1}} \end{picture}} \setlength{\unitlength}{\clobberlength}\g@meboard} \def\Clobber{ \@clobberbase \def\@gameboard##1{% \begin{picture}(\number\@gamecols,\number\@gamerows) {\advance\@gamecols by 1 \multiput(0,0)(1,0){\number\@gamecols} {\drawline(0,0)(0,\number\@gamerows)}} {\advance\@gamerows by 1 \multiput(0,0)(0,1){\number\@gamerows} {\drawline(0,0)(\number\@gamecols,0)}} \uppercase{\@gameboardprocess{##1}} \end{picture}} \setlength{\unitlength}{\Clobberlength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\dotsandboxes{ \def\@gamedisplaychar##1{ \put(-1,-1){\put(\number\@gamecol,\number\@gamerow){% this comment required for eepic \ifx##1o\put(0,0){\circle*{.3}}\fi \ifx##1-\drawline(-1,0)(1,0)\fi \ifx##1|\drawline(0,-1)(0,1)\fi \ifx##1:\d@tt@dline(0,-1)(0,1)\fi \ifx##1+\d@tt@dline(-1,0)(1,0)\fi \ifx##1A\put(0,0){\makebox(0,0){\bf{A}}}\fi \ifx##1B\put(0,0){\makebox(0,0){\bf{B}}}\fi}}} \def\@gameboard##1{{ \@gamedecrementdims \begin{picture}(\number\@gamecols,\number\@gamerows) \@gameincrementdims \@gameboardprocess{##1} \end{picture}}} \setlength{\unitlength}{\dotsandboxeslength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\@@coin#1{\put(0,0){\circle{1.2}}\put(0,0){\makebox(0,0){#1}}} \def\stringsandcoins{ \def\@gamedisplaychar##1{ \put(-1,-1){\put(\number\@gamecol,\number\@gamerow){% this comment required for eepic \ifx##1o\@@coin{\$}\fi \ifx##1-\drawline(-.4,0)(.4,0)\fi \ifx##1+\d@tt@dline(-.4,0)(.4,0)\fi \ifx##1:\d@tt@dline(0,-.4)(0,.4)\fi \ifx##1|\drawline(0,-.4)(0,.4)\fi \ifx##1A\@@coin{\bf A}\fi \ifx##1B\@@coin{\bf B}\fi }} } \def\@gameboard##1{{ \begin{picture}(\number\@gamecols,\number\@gamerows)(-.5,-.5) \@gameboardprocess{##1} \end{picture}}} \setlength{\unitlength}{\stringsandcoinslength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\chomp{ \def\@square{\drawline(0,0)(1,0)(1,1)(0,1)(0,0)} \def\@poison{\@square\drawline(.2,.2)(.8,.8)\drawline(.2,.8)(.8,.2)\put(.5,.5){\circle{.6}}} \def\@gamedisplaychar##1{ \put(-1,-1){\put(\number\@gamecol,\number\@gamerow){% this comment required for eepic \ifx##1O\@square\fi \ifx##1X\@poison\fi }} } \def\@gameboard##1{{ \begin{picture}(\number\@gamecols,\number\@gamerows) \@gameboardprocess{##1} \end{picture}}} \setlength{\unitlength}{\chomplength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\bridgit{ \def\@gamedisplaychar##1{ \put(-1,-1){\put(\number\@gamecol,\number\@gamerow){% this comment required for eepic \ifx##1o\put(0,0){\circle{.4}}\fi \ifx##1x\put(0,0){\circle*{.4}}\fi \ifx##1-\drawline(-.8,0)(.8,0)\fi \ifx##1|\drawline(0,-.8)(0,.8)\fi \ifx##1+ \d@tt@dline(-.8,0)(.8,0)\fi \ifx##1:\d@tt@dline(0,-.8)(0,.8)\fi }} } \def\@gameboard##1{{ \begin{picture}(\number\@gamecols,\number\@gamerows) \@gameboardprocess{##1} \end{picture}}} \setlength{\unitlength}{\bridgitlength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\domineering{ \def\@gamedisplaychar##1{% \put(-1,-1){\put(\number\@gamecol,\number\@gamerow){% this comment required for eepic \ifx##1o\drawline(0,0)(1,0)(1,1)(0,1)(0,0)\fi% \ifx##1x\pspolygon*[unit=1\unitlength,linewidth=0pt,linecolor=gray](0,0)(0,1)(1,1)(1,0)\fi% \ifx##1^\fi% \ifx##1>\fi% \ifx##1v\pspolygon*[linewidth=0pt]% (.4,.4)(.2,.2)(.8,.2)(.6,.4)(.6,1.6)(.8,1.8)(.2,1.8)(.4,1.6)% \drawline(0,0)(1,0)(1,2)(0,2)(0,0)\fi \ifx##1<\pspolygon*[linewidth=0pt]% (.4,.4)(.2,.2)(.2,.8)(.4,.6)(1.6,.6)(1.8,.8)(1.8,.2)(1.6,.4)% \drawline(0,0)(0,1)(2,1)(2,0)(0,0)\fi% }} } \def\@gameboard##1{{ \begin{picture}(\number\@gamecols,\number\@gamerows) \@gameboardprocess{##1} \end{picture}}} \setlength{\unitlength}{\domineeringlength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\amazons{ \def\@gamedisplaychar##1{% \def\#box{\drawline(0,0)(1,0)(1,1)(0,1)(0,0)} \put(-1,-1){\put(\number\@gamecol,\number\@gamerow){% this comment required for eepic \ifx##1o\#box\fi% \ifx##1x\#box\put(.5,.5){\circle*{.5}}\fi% \ifx##1L\#box\put(.5,.5){\makebox(0,0){\Chess q}}\fi% \ifx##1R\#box\put(.5,.5){\makebox(0,0){\Chess Q}}\fi% }} } \def\@gameboard##1{{ \begin{picture}(\number\@gamecols,\number\@gamerows) \@gameboardprocess{##1} \end{picture}}} \setlength{\unitlength}{\domineeringlength}\g@meboard} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \catcode`\@=\next % restore @ status