1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
%%%%%%%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
%
|