summaryrefslogtreecommitdiff
path: root/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-generic.tex
blob: c703e99061f738e04810be4e5ef3a722084dc661 (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
%D \module
%D   [       file=t-go-generic,
%D        version=2007.08.15,
%D          title=\CONTEXT\ User Module,
%D       subtitle=Go extensions,
%D         author={Zhichu Chen \& Wolfgang Schuster},
%D           date=\currentdate,
%D      copyright=Public Domain]

\writestatus{loading}{Context User Module / Go extensions}

\unprotect

\startvariables all
          game: game
         stone: stone
         black: black
         white: white
\stopvariables

\startconstants all
     printable: printable
\stopconstants

\def\????bd{@@@@bd} % BoarD

\newif\ifhighlightlabel \highlightlabeltrue

\def\dosetupboardsize[#1]%
  {\assigndimension{#1}\boardsize{9}{13}{19}}

\def\setupboardsize
  {\dosingleargument\dosetupboardsize}

\def\dosetupboard[#1][#2]%
  {\ifsecondargument
     \getparameters[\????bd#1][#2]%
   \else
     \getparameters[\????bd][#1]%
     \setupboardsize[\@@@@bdsize]%
   \fi}

\def\setupboard
  {\dodoubleempty\dosetupboard}

\def\charactertonumber#1%
  {\ifx#1a1\else
   \ifx#1b2\else
   \ifx#1c3\else
   \ifx#1d4\else
   \ifx#1e5\else
   \ifx#1f6\else
   \ifx#1g7\else
   \ifx#1h8\else
   \ifx#1i9\else
   \ifx#1j10\else
   \ifx#1k11\else
   \ifx#1l12\else
   \ifx#1m13\else
   \ifx#1n14\else
   \ifx#1o15\else
   \ifx#1p16\else
   \ifx#1q17\else
   \ifx#1r18\else
   \ifx#1s19\else
   \ifx#1t20\else
   \ifx#1u21\else
   \ifx#1v22\else
   \ifx#1w23\else
   \ifx#1x24\else
   \ifx#1y25\else
   \ifx#1z26\fi\fi
   \fi\fi\fi\fi\fi
   \fi\fi\fi\fi\fi
   \fi\fi\fi\fi\fi
   \fi\fi\fi\fi\fi
   \fi\fi\fi\fi}

\def\sgfcharacter#1%
  {\ifcase#1\unknowncharacter
    \or A\or B\or C\or D\or E\or F\or G\or H\or J\or K\or L\or M\or N%
    \or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\or
   \else
     \unknowncharacter
   \fi}

\setupboard
  [\c!alternative=\v!a,
   \c!calculate=\v!no,
   \c!color=\v!black,
   \c!conversion=stone 2,
   \c!distance=\boardunit,
   \c!n=3,
   \c!printable=\v!no,
   \c!size=\v!big,
   \c!style=\v!sans]

\setupboard
  [\v!black]
  [\c!style=\@@@@bdstyle,
   \c!color=\v!white]

\setupboard
  [\v!white]
  [\c!style=\@@@@bdstyle,
   \c!color=\v!black]

\protect \endinput