%%%%%%%play.tex%%%%%%% %\input{play.tex} %Modified 11/11/91 Central table \bplay etc % bplay, showgame, pc, strip \def\eplay{\errormessage{% bplay command is missing}} % \def\bplay{\bgroup\global\trno=0 \def\eplay{\egroup\egroup} \def\bintermezzo{\noalign\bgroup \smallskip\noindent} \def\eintermezzo{\smallskip\egroup} \tabskip1ex plus 1fill \halign to\hsize\bgroup \tabskip1ex plus 1ex minus 1ex \global\advance\trno by 1 % \hbox to.5\wr{\hss\the\trno\hss}%<=! \hbox to\wr{\pc\FIP##\hss}\hfil& \hbox to\wr{\pc\SEP##\hss}\hfil& \hbox to\wr{\pc\THP##\hss}\hfil& \hbox to\wr{\pc\FOP##\hss}\hfil \tabskip4ex plus2ex minus1ex& \hbox to.5\wr{\hss##\hss} \tabskip1ex plus 1ex minus 1ex& \hbox to.5\wr{\hss##\hss} \tabskip1ex plus 1fill\cr %End template line, next is headline \omit\hbox to1\wr{\TRICK\hss}\hfil& \omit\hfil&\omit\hfil&\omit\hfil& %Note only 3 \omits \NS&\EW\cr%Headline }% end \bplay % \def\pc#1#2#3{% Version 3/3/90 %Function: prints card #2#3 and % deletes it from player #1 %#1 the hand N, E, S, W(uppercase) %#2 colour s, h, d, or c %#3 card value A K Q ... 2, or x %(or your (consistent/language) choice) %%%% 1. Update hand \#1#2; e.g. \Ns %%% \xdef\hnd{\csname #1#2\endcsname} \strip{#3}{\hnd}% %%%% 2. print card in table %%% \xdef\colour{\csname #2\endcsname} \colour\thinspace #3% % %Needed for immediate postfix mark(s) }% end \pc % \def\strip#1#2{% Version 3/3/90 %Function: deletes card value #1 % from #2, i.e., \Ns, or ... \def\wis##1#1##2\wis{% %Function: #1 is deleted from argument % in \wis ... \wis and result % is assigned to \hnd; % (last card is replaced by --) \global\hnd={##1##2} \xdef\pa{##1} \xdef\pb{##2} \ifx\pa\empty {\ifx\pb\empty \global\hnd={--}% void colour \fi}\fi }% end \wis \expandafter\wis\the #2\wis }% end \strip % \def\showgame{ %Purpose: Shows all cards still active % in the play, via \Ns, ..., \Wc, % (note use of upper case for players) %Used: \crdima, \hand, \LFTINF, \RGTINF % \Ns, ..., \Wc $$\crdima{\LFTINF}{\RGTINF}% {\hand{\the\Ns}{\the\Nh}{\the\Nd}% {\the\Nc}}% {\hand{\the\Es}{\the\Eh}{\the\Ed}% {\the\Ec}}% {\hand{\the\Ss}{\the\Sh}{\the\Sd}% {\the\Sc}}% {\hand{\the\Ws}{\the\Wh}{\the\Wd}% {\the\Wc}}% $$}% end \showgame %end input play.tex % In total: 215 lines %