<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%% psbao.sty
%% Copyright 2008 N. Vessella
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% This package consists of the files:
%
%   psbao.sty
%   psbaomanual.tex
%   psbaomanual.pdf
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MOST OF THE FOLLOWING CODE IS COPIED FROM psgo.sty %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\NeedsTeXFormat{LaTeX2e}% 
\ProvidesPackage{psbao}[2008/11/01, v0.11]
\message{`PSBAO', &lt;2008/11/01&gt;, v0.11}
\RequirePackage{pstricks,calc,ifthen,cool,etex}
%\RequirePackage{pstricks,pst-node,calc,ifthen,cool,etex}
\newcommand{\psbao}{\textsf{psbao}}
%\newsavebox{\stmarkbox}
\newcounter{boardrow}
\newcounter{boardcol}
\newcounter{ghalaku} % granaio sud
\newcounter{ghalaka} % granaio nord
\newcounter{tmpglob}
\newlength{\baoxunit}
\newlength{\baoyunit}
\newcounter{nvi}
\newcounter{nvii}
\newcounter{nviii}
\newcounter{nviv}
\newcounter{nvv}
\newcounter{nvvi}
\newcounter{nvvii}
\newcounter{nvviii}
\newcounter{nvix}
\newcounter{nvx}
\newcounter{nvxi}
\newcounter{nvxii}
\newcounter{nvxiii}
\newcounter{nvxiv}
\newcounter{nvxv}
\newcounter{nvxvi}
\newcounter{nvxvii}
\newcounter{nvxviii}
\newcounter{nvxix}
\newcounter{nvxx}
\newcounter{nvxxi}
\newcounter{nvxxii}
\newcounter{nvxxiii}
\newcounter{nvxxiv}
\newcounter{nvxxv}
\newcounter{nvxxvi}
\newcounter{nvxxvii}
\newcounter{nvxxviii}
\newcounter{nvxxix}
\newcounter{nvxxx}
\newcounter{nvxxxi}
\newcounter{nvxxxii}
\newcounter{nvxxxiii}
\newcounter{nvxxxiv}

 \newcount\nord
 \newcount\b
 \newcount\sud

\newcommand{\setbaounit}[1]{
 \setlength{\baoxunit}{#1}
 \setlength{\baoyunit}{1.115\baoxunit}
}

\newcommand{\initbao}[1][22,%
                        0,0,0,0,0,0,0,0,%
                        0,2,2,6,0,0,0,0,%
                        0,0,0,0,6,2,2,0,%
                        0,0,0,0,0,0,0,0,%
                        22]{%
 \liststore{#1}{bc}
 % There should be a better way to write the following lines!
 \setcounter{nvi}{\bci}
 \setcounter{nvii}{\bcii}
 \setcounter{nviii}{\bciii}
 \setcounter{nviv}{\bciv}
 \setcounter{nvv}{\bcv}
 \setcounter{nvvi}{\bcvi}
 \setcounter{nvvii}{\bcvii}
 \setcounter{nvviii}{\bcviii}
 \setcounter{nvix}{\bcix}
 \setcounter{nvx}{\bcx}
 \setcounter{nvxi}{\bcxi}
 \setcounter{nvxii}{\bcxii}
 \setcounter{nvxiii}{\bcxiii}
 \setcounter{nvxiv}{\bcxiv}
 \setcounter{nvxv}{\bcxv}
 \setcounter{nvxvi}{\bcxvi}
 \setcounter{nvxvii}{\bcxvii}
 \setcounter{nvxviii}{\bcxviii}
 \setcounter{nvxix}{\bcxix}
 \setcounter{nvxx}{\bcxx}
 \setcounter{nvxxi}{\bcxxi}
 \setcounter{nvxxii}{\bcxxii}
 \setcounter{nvxxiii}{\bcxxiii}
 \setcounter{nvxxiv}{\bcxxiv}
 \setcounter{nvxxv}{\bcxxv}
 \setcounter{nvxxvi}{\bcxxvi}
 \setcounter{nvxxvii}{\bcxxvii}
 \setcounter{nvxxviii}{\bcxxviii}
 \setcounter{nvxxix}{\bcxxix}
 \setcounter{nvxxx}{\bcxxx}
 \setcounter{nvxxxi}{\bcxxxi}
 \setcounter{nvxxxii}{\bcxxxii}
 \setcounter{nvxxxiii}{\bcxxxiii}
 \setcounter{nvxxxiv}{\bcxxxiv}
}

\newcommand{\initjbao}{
  \setcounter{nvi}{0}
  \setcounter{tmpglob}{2}
  \whiledo{\value{tmpglob} &lt; 34}
  {%
   \setcounter{nv\roman{tmpglob}}{2}
  \stepcounter{tmpglob}%
  }%
  \setcounter{nvxxxiv}{0}
}

\initbao
\setbaounit{0.6cm}
%\newcommand{\hatchangle}{-42.5} % non usato
\newlength{\tmplx}
\newlength{\tmply}
%\newlength{\tmpxa}% non usato
%\newlength{\tmpxb}% non usato
%\newlength{\tmpya}% non usato
%\newlength{\tmpyb}% non usato
\newcounter{tmpc}

\newcommand{\pointbox}[1]{%
\raisebox{-0.5\height+0.5\depth}[0pt][0pt]{\makebox[0pt]{#1}}%
}

%\newcommand{\baolabelformat}[1]{{\sffamily #1}}
\newcommand{\baolabelformat}[1]{%
{\sffamily {\footnotesize{#1}}}%
}

\newcommand{\baoxposition}[1]{%
	\ifx#1B 0\else%
	\ifx#1A 1\else%
	\ifx#1a 2\else%
	\ifx#1b 3\else%
	\ifx#1c 2\else%
	\ifx#1d 3\else%
	\ifx#1e 4\else%
	\ifx#1f 5\else%
	\ifx#1g 6\else%
	\ifx#1h 7\else%
	\ifx#1j 8\else%
	\ifx#1k 9\else%
	\ifx#1l 10\else%
	\ifx#1m 11\else%
	\ifx#1n 12\else%
	\ifx#1o 13\else%
	\ifx#1p 14\else%
	\ifx#1q 15\else%
	\ifx#1r 16\else%
	\ifx#1s 17\else%
	\ifx#1t 18\else%
	\relax%
	\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}%

\newcommand{\baoyposition}[1]{%
	\ifnum#1=1 0\else%
	\ifnum#1=2 1\else%
	\ifnum#1=3 2\else%
	\ifnum#1=4 3\else%
	\ifnum#1=5 4\else%
	\ifnum#1=6 5\else%
	\ifnum#1=7 6\else%
	\ifnum#1=8 7\else%
	\ifnum#1=9 8\else%
	\ifnum#1=10 9\else%
	\ifnum#1=11 10\else%
	\ifnum#1=12 11\else%
	\ifnum#1=13 12\else%
	\ifnum#1=14 13\else%
	\ifnum#1=15 14\else%
	\ifnum#1=16 15\else%
	\ifnum#1=17 16\else%
	\ifnum#1=18 17\else%
	\ifnum#1=19 18\else%
	\relax%
	\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}%

\newcommand{\redim}[1]{%
 \ifdim \baoxunit &gt; 24pt
  {\LARGE{#1}}
 \else%
  \ifdim \baoxunit &gt; 20pt
   {\Large{#1}}
  \else%
   \ifdim \baoxunit &gt; 17pt
    {\large{#1}}
   \else%
    \ifdim \baoxunit &gt; 14pt
     {\normalsize{#1}}
    \else%
     \ifdim \baoxunit &gt; 12pt
      {\small{#1}}
     \else%
	   \ifdim \baoxunit &gt; 10pt
       {\footnotesize{#1}}
      \else%
	    \ifdim \baoxunit &gt; 9pt
        {\scriptsize{#1}}
       \else%
        {\tiny{#1}}%
       \fi
      \fi
     \fi
    \fi
   \fi%
  \fi
 \fi%
}%

\newcommand{\conx}[2]{%
 % There should be a better way to write this command!
 \nord=9
 \sud=#2
 \setcounter{tmpc}{#2}
 \advance \nord by -\value{tmpc}
 \if #1b
   \setcounter{tmpc}{\nord}%
 \else
  \if #1a
   \setcounter{tmpc}{\nord}%
  \else
   \if #1A
    \setcounter{tmpc}{\sud}%
   \else
    \if #1B
     \setcounter{tmpc}{\sud}%
    \fi
   \fi
  \fi
 \fi
 \b=\value{tmpc}
}%

\newenvironment{baomoves}{%
 \newcommand{\placesymbol}[3]{%
  \ifthenelse{4 &gt; \baoxposition{##2}%
              \and %
              8 &gt; \baoyposition{##3}}%
    {\rput[l](\baoyposition{##3},\baoxposition{##2}){\redim{##1}}%
    }%
    {}%
 }%
 \newcommand{\markpos}[3]
 {%
 \conx{##2}{##3}
 \placesymbol{\psframebox[dimen=inner,%
                         linestyle=none,%
                         boxsep=false,%
                         framesep=0.3\baoxunit]{##1}}{##2}{\value{tmpc}}
 }%
 \newcommand{\kete}[3]
 {%
  \placesymbol{%
   {\psset{linecolor=black,%
        fillcolor=black,%
        hatchcolor=gray,%
        unit=0.5\baoxunit}\color{black}##1}}{##2}{##3}%
 }%
 \newcommand{\ghala}[3]
 {%
 \ifx ##2S
   \setcounter{ghalaku}{##1} % 20
   \setcounter{ghalaka}{0}
 \else
  \ifx ##2s
   \setcounter{ghalaku}{##1} % 20
   \setcounter{ghalaka}{0}
  \else
   \setcounter{ghalaku}{0}
   \setcounter{ghalaka}{##1} % 19
  \fi
 \fi
 \ifnum \value{ghalaka}&gt;0% 
  \rput(-1\baoxunit,2.5\baoyunit){\redim{\arabic{ghalaka}}}% % 19
 \fi%
 \ifnum \value{ghalaku}&gt;0%
  \rput(8.3\baoxunit,0.5\baoyunit){\redim{\arabic{ghalaku}}}% % 19
 \fi%
 \setcounter{ghalaku}{0}
 \setcounter{ghalaka}{0}
 }%

\renewcommand{\seeds}[3]{%
% \kete[\stmark]{##2}{\conx{##2}{##3}}%
 \def\stmark{\pointbox{##1}}%
 % Here should be used the macro \conx
 \nord=9
 \sud=##3
% \b=##3
 \advance \nord by -\sud
 \if ##2b
  \kete{\stmark}{##2}{\nord}%
 \else
  \if ##2a
   \kete{\stmark}{##2}{\nord}%
  \else
   \if ##2A
    \kete{\stmark}{##2}{\sud}%
   \else
    \if ##2B
     \kete{\stmark}{##2}{\sud}%
    \else
     \ghala{##1}{##2}{##3}%
    \fi
   \fi
  \fi
 \fi
}%
%
\newcommand{\baoarrow}[2]
{

\conx{##1}{##2}
%\pstriangle[gangle=90](\baoyposition{\value{tmpc}},\baoxposition{##1})(1,.5)
% It doesn't work! It doesn't accept the multiplication of \baoxposition,
% I will be greatful for any help.
\psdots[dotstyle=triangle*,dotscale=2](\baoyposition{\value{tmpc}},.5\baoxposition{##1})
%\psline[linewidth=1.4pt,
%        linecolor=black,
%        linestyle=solid,
%        arrowscale=1.5]%
%		{&gt;-}%
%		(\baoyposition{\b},\baoxposition{##1})
%		(\baoyposition{\b},\baoxposition{##1})
%		(0.1\baoyposition{##2},\baoxposition{\b})%
%}		
}%
}{}%

\newcommand{\xpositionmarks}[2]{%
   \setcounter{tmpglob}{9}%
	\whiledo{\value{#1} &lt; #2}{%
	  \rput[B](\value{#1},-1.1\baoyunit){%
	    \addtocounter{#1}{1}%
	    \ifthenelse{\value{#1} &gt; 8}%
   {\addtocounter{#1}{1}\baolabelformat{\arabic{#1}}\addtocounter{#1}{-1}}%
	      {\baolabelformat{\arabic{#1}}}%
	    \addtocounter{#1}{-1}}%
     \setlength{\tmply}{4\baoyunit}%
	  \rput[t](\value{#1},\tmply){%
	    \addtocounter{#1}{1}%
	    \ifthenelse{\value{#1} &gt; 4}%
	      {\addtocounter{#1}{1}
	       \addtocounter{tmpglob}{-1}%
          \baolabelformat{\arabic{tmpglob}}
          \addtocounter{#1}{-1}
         }%
	      {
         \addtocounter{tmpglob}{-1}%
         \baolabelformat{\arabic{tmpglob}}
         }%
	    \addtocounter{#1}{-1}}%
	  \stepcounter{#1}%
	  }%
}%
\newcommand{\ypositionmarks}[2]{%
	\whiledo{\value{#1} &lt; 4}{%
     \ifthenelse{\value{#1} &gt; 1}%
	      {%
          \addtocounter{#1}{-1}
			 \edef\etnord{\alph{#1}}%
          \addtocounter{#1}{1}%
          \setlength{\tmplx}{#2\baoxunit}%
          \rput[l](\tmplx,\value{#1}){\baolabelformat{\etnord}}%
         }%
	      {%
          \ifthenelse{\value{#1} = 0}
          {
          \addtocounter{#1}{2}
			 \edef\etsud{\Alph{#1}}
          \addtocounter{#1}{-2}
          }
          {
			 \edef\etsud{\Alph{#1}}
          }
          \rput[r](-\baoxunit,\value{#1}){\baolabelformat{\etsud}}%
         }%
      \stepcounter{#1}%
	}%
}%

\def\psbaosetboardsizes(#1,#2)(#3,#4){%
  \def\psbaollx{#1}%
  \def\psbaolly{#2}%
%  \ifthenelse{#3 &gt; \value{boardcol}}
%   {\def\psbaourx{\value{boardcol}}}
%   {\def\psbaourx{#3}}%
  \def\psbaourx{#3}%
%  \ifthenelse{#4 &gt; \value{boardrow}}
%   {\def\psbaoury{\value{boardrow}}}
%   {\def\psbaoury{#4}}%
  \def\psbaoury{#4}%
}

\newboolean{withindices}%
\setboolean{withindices}{true}%

% psbaopartialboard[8](0,0)(8,4)
\newenvironment{psbaopartialboard}[2][8]
{%
	\setcounter{boardcol}{8}%
	\setcounter{boardrow}{4}%
   \psbaosetboardsizes#2%
	\psset{xunit=\baoxunit,yunit=\baoyunit}%
    \ifthenelse{\boolean{withindices}}%
              {\def\xoffset{2\baoxunit}\def\yoffset{2\baoyunit}}%
              {\def\xoffset{.5\baoxunit}\def\yoffset{.5\baoyunit}}%
    % psbaollx=0
    \ifthenelse{\psbaollx = 1 \or \psbaollx &lt; 1}%
              {\def\psbaollxval{-\xoffset}}%
              {\setlength%
               {\tmplx}%
               {\psbaollx\baoxunit - 1\baoxunit}%
               \edef\psbaollxval{\the\tmplx}%
              }%
    % psbaoly=0
    \ifthenelse{\psbaolly = 1 \or \psbaolly &lt; 1}%
               {\def\psbaollyval{-.5\yoffset}}%
               {\setlength{\tmply}{\psbaolly\baoyunit - 1\baoyunit}\edef\psbaollyval{\the\tmply}}%
    % psbaorx=8 
    \ifthenelse{\psbaourx = \value{boardcol} \or \psbaourx &gt; \value{boardcol}}%
               {\setlength{\tmplx}{\value{boardcol}\baoxunit - \baoxunit + \xoffset}%
                \edef\psbaourxval{\the\tmplx}}%
               {\def\psbaourxval{\psbaourx\baoxunit}}%
    % psbaory=4
    \ifthenelse{\psbaoury = \value{boardrow} \or \psbaoury &gt; \value{boardrow}}%
               {\setlength{\tmply}{\value{boardrow}\baoyunit - \baoyunit + \yoffset}%
                \edef\psbaouryval{\the\tmply}}%
               {\def\psbaouryval{\psbaoury\baoyunit}}%
   %                     0,         0            8,           4
	\begin{pspicture}(\psbaollxval,\psbaollyval)(\psbaourxval,\psbaouryval)%
    \ifthenelse{\psbaollx = 1 \or \psbaollx &lt; 1}%
               {\def\psbaollxval{-\xoffset}}%
               {\setlength{\tmplx}{\psbaollx\baoxunit - 1.5\baoxunit}\edef\psbaollxval{\the\tmplx}}%
    \ifthenelse{\psbaolly = 1 \or \psbaolly &lt; 1}%
               {\def\psbaollyval{-\yoffset}}%
               {\setlength{\tmply}{\psbaolly\baoyunit - 1.5\baoyunit}\edef\psbaollyval{\the\tmply}}%
    \ifthenelse{\psbaourx = \value{boardcol} \or \psbaourx &gt; \value{boardcol}}%
               {\setlength{\tmplx}{\value{boardcol}\baoxunit - \baoxunit + \xoffset}%
                \edef\psbaourxval{\the\tmplx}}%
               {\setlength{\tmplx}{\psbaourx\baoxunit - .5\baoxunit}%
                \edef\psbaourxval{\the\tmplx}}%
    \ifthenelse{\psbaoury = \value{boardrow} \or \psbaoury &gt; \value{boardrow}}%
               {\setlength{\tmply}{\value{boardrow}\baoyunit - \baoyunit + \yoffset}%
                \edef\psbaouryval{\the\tmply}}%
               {\setlength{\tmply}{\psbaoury\baoyunit - .5\baoyunit}%
                \edef\psbaouryval{\the\tmply}}%
\psclip{\psframe[linecolor=white,linewidth=0](\psbaollxval,\psbaollyval)(\psbaourxval,\psbaouryval)}%
	\setlength{\tmply}{\value{boardrow}\baoyunit + 0.5\baoyunit}%
	\setlength{\tmplx}{\value{boardcol}\baoxunit + 0.5\baoxunit}%
	\addtolength{\tmply}{-1.5\baoyunit}%
	\addtolength{\tmplx}{-1.5\baoxunit}%
	
\multips(0,0)(1,0){\value{boardcol}}
{\pscircle[fillstyle=solid,linewidth=0.5pt](0,0){0.4\baoxunit}
\multips(0,0)(0,1){\value{boardrow}}{\pscircle[fillstyle=solid,linewidth=0.5pt](0,0){0.4\baoyunit}}
}%	
	%\psframe[linewidth=0pt](0,0)(\tmplx,\tmply)%
\ifthenelse{\boolean{withindices}}
{\setcounter{tmpc}{0}%
 \xpositionmarks{tmpc}{\value{boardcol}}%
 \setcounter{tmpc}{0}%
 \ypositionmarks{tmpc}{\value{boardcol}}%
}{\relax}%
\pspolygon[fillstyle=solid,linewidth=.5pt](2.5\baoxunit,1.6\baoyunit)% Nyumba
          (2.5\baoxunit,2.4\baoyunit)% 2
          (3.5\baoxunit,2.4\baoyunit)% 3
          (3.5\baoxunit,1.6\baoyunit) % 4 quadrata   
\pspolygon[fillstyle=solid,linewidth=.5pt](3.5\baoxunit,0.6\baoyunit)% Nyumba
          (3.5\baoxunit,1.4\baoyunit)% 2
          (4.5\baoxunit,1.4\baoyunit)% 3
          (4.5\baoxunit,0.6\baoyunit) % 4 quadrata   
% granai
\pspolygon[linearc=.5\baoxunit,linewidth=.5pt](-1.6\baoxunit,1.6\baoyunit)%
                      (-1.6\baoxunit,3.4\baoyunit)%
                      (-0.7\baoxunit,3.4\baoyunit)%
                      (-0.7\baoxunit,1.6\baoyunit)%
\pspolygon[linearc=.5\baoxunit,linewidth=.5pt](7.7\baoxunit,-0.4\baoyunit)%
                      (7.7\baoxunit,1.4\baoyunit)%
                      (8.6\baoxunit,1.4\baoyunit)%
                      (8.6\baoxunit,-0.4\baoyunit)%
\begin{baomoves}
  \ifnum \value{nvi}&gt;0 {\seeds{\arabic{nvi}}{n}{1}}{}\fi%
  \ifnum \value{nvxxxiv}&gt;0 {\seeds{\arabic{nvxxxiv}}{s}{1}}{}\fi%
  \ifnum \value{nvii}&gt;0 {\seeds{\arabic{nvii}}{b}{8}}{}\fi%
  \ifnum \value{nviii}&gt;0 {\seeds{\arabic{nviii}}{b}{7}}{}\fi%
  \ifnum \value{nviv}&gt;0 {\seeds{\arabic{nviv}}{b}{6}}{}\fi%
  \ifnum \value{nvv}&gt;0 {\seeds{\arabic{nvv}}{b}{5}}{}\fi%
  \ifnum \value{nvvi}&gt;0 {\seeds{\arabic{nvvi}}{b}{4}}{}\fi%
  \ifnum \value{nvvii}&gt;0 {\seeds{\arabic{nvvii}}{b}{3}}{}\fi%
  \ifnum \value{nvviii}&gt;0 {\seeds{\arabic{nvviii}}{b}{2}}{}\fi%
  \ifnum \value{nvix}&gt;0 {\seeds{\arabic{nvix}}{b}{1}}{}\fi%
  \ifnum \value{nvx}&gt;0 {\seeds{\arabic{nvx}}{a}{8}}{}\fi%
  \ifnum \value{nvxi}&gt;0 {\seeds{\arabic{nvxi}}{a}{7}}{}\fi%
  \ifnum \value{nvxii}&gt;0 {\seeds{\arabic{nvxii}}{a}{6}}{}\fi%
  \ifnum \value{nvxiii}&gt;0  {\seeds{\arabic{nvxiii}}{a}{5}}{}\fi%
  \ifnum \value{nvxiv}&gt;0 {\seeds{\arabic{nvxiv}}{a}{4}}{}\fi%
  \ifnum \value{nvxv}&gt;0 {\seeds{\arabic{nvxv}}{a}{3}}{}\fi%
  \ifnum \value{nvxvi}&gt;0 {\seeds{\arabic{nvxvi}}{a}{2}}{}\fi%
  \ifnum \value{nvxvii}&gt;0 {\seeds{\arabic{nvxvii}}{a}{1}}{}\fi%
  \ifnum \value{nvxviii}&gt;0 {\seeds{\arabic{nvxviii}}{A}{1}}{}\fi%
  \ifnum \value{nvxix}&gt;0 {\seeds{\arabic{nvxix}}{A}{2}}{}\fi%
  \ifnum \value{nvxx}&gt;0 {\seeds{\arabic{nvxx}}{A}{3}}{}\fi%
  \ifnum \value{nvxxi}&gt;0 {\seeds{\arabic{nvxxi}}{A}{4}}{}\fi%
  \ifnum \value{nvxxii}&gt;0 {\seeds{\arabic{nvxxii}}{A}{5}}{}\fi%
  \ifnum \value{nvxxiii}&gt;0 {\seeds{\arabic{nvxxiii}}{A}{6}}{}\fi%
  \ifnum \value{nvxxiv}&gt;0 {\seeds{\arabic{nvxxiv}}{A}{7}}{}\fi%
  \ifnum \value{nvxxv}&gt;0 {\seeds{\arabic{nvxxv}}{A}{8}}{}\fi%
  \ifnum \value{nvxxvi}&gt;0 {\seeds{\arabic{nvxxvi}}{B}{1}}{}\fi%
  \ifnum \value{nvxxvii}&gt;0 {\seeds{\arabic{nvxxvii}}{B}{2}}{}\fi%
  \ifnum \value{nvxxviii}&gt;0 {\seeds{\arabic{nvxxviii}}{B}{3}}{}\fi%
  \ifnum \value{nvxxix}&gt;0 {\seeds{\arabic{nvxxix}}{B}{4}}{}\fi%
  \ifnum \value{nvxxx}&gt;0 {\seeds{\arabic{nvxxx}}{B}{5}}{}\fi%
  \ifnum \value{nvxxxi}&gt;0 {\seeds{\arabic{nvxxxi}}{B}{6}}{}\fi%
  \ifnum \value{nvxxxii}&gt;0 {\seeds{\arabic{nvxxxii}}{B}{7}}{}\fi%
  \ifnum \value{nvxxxiii}&gt;0 {\seeds{\arabic{nvxxxiii}}{B}{8}}{}\fi%
}%
{
\end{baomoves}%
    \endpsclip%
	\end{pspicture}%
}%

\newenvironment{showbaoboard}[1][8]{%
  \begin{psbaopartialboard}[8]{(0,0)(8,4)}%
}
{%
  \end{psbaopartialboard}%
}
\newcommand{\nomark}{\relax}%
\newcommand{\factor}{0.28284271247461901}% = 2/5 * sin(1/4 * pi)
\newcommand{\markma}{%
	\psline[linewidth=1.4pt](-\factor,-\factor)(\factor,\factor)%
	\psline[linewidth=1.4pt](-\factor,\factor)(\factor,-\factor)%
}
\newcommand{\marksx}{%
	\rput(-.5\baoxunit,0)%
	{%
	\psline[linewidth=1.4pt](.5\baoxunit,-.5\baoxunit)
	\psline[linewidth=1.4pt](.5\baoxunit,.5\baoxunit)
	%\pstriangle(-.1\baoxunit,0.1\baoxunit)%
	}%
}%
\newcommand{\markdx}{%
	\rput(.5\baoxunit,0)%
	{%
	\psline(-.5\baoxunit,-.5\baoxunit)
	\psline(-.5\baoxunit,.5\baoxunit)
	%\pstriangle(-.1\baoxunit,0.1\baoxunit)%
	}%
}%
\newcommand{\marksl}{%
\psframe[fillstyle=solid,fillcolor=gray,linecolor=gray](-0.22\baoxunit,-0.22\baoxunit)(0.22\baoxunit,0.22\baoxunit)%
}%
\newcommand{\markdd}{%
 \psframe[dimen=middle,%
    fillstyle=vlines,%
    hatchsep=2pt,%
    hatchwidth=0.4pt,%
    hatchangle=0,%
    linestyle=none]%
	 (-0.6\baoxunit,-0.5\baoyunit)(0.5\baoxunit,0.5\baoyunit)%
}%

\newcommand{\markss}{%
 \psframe[dimen=middle,%
    fillstyle=hlines,%
    hatchsep=2pt,%
    hatchwidth=0.6pt,%
    hatchangle=0,%
    linestyle=none]%
	 (-0.5\baoxunit,-0.5\baoyunit)(0.5\baoxunit,0.5\baoyunit)%
}%

\newcommand{\seeds}[1]{%
  \setlength{\tmply}{-0.5\baoxunit + 0.5ex}%
  \raisebox{\tmply}{\psset{unit=\baoxunit}%
  \begin{pspicture}(-0.5,-0)(0.5,1)%
\rput(0,0.5){{\psset{linecolor=white,unit=0.5}\color{white}\baolabelformat{#1}}}%
  \end{pspicture}}
}%

\newcommand{\weka}[3]{%
 % \kete[\stmark]{##2}{\conx{##2}{##3}}%
 \b=#3
 \if #2b
   \nord=10
   \advance \nord by -\b
   \setcounter{nv\romannumeral\nord}{#1}%
 \else
  \if #2a
   \nord=18
   \advance \nord by -\b
   \setcounter{nv\romannumeral\nord}{#1}%
  \else
   \if #2A
    \nord=17
    \advance \nord by \b
    \setcounter{nv\romannumeral\nord}{#1}%
   \else
    \if #2B
	  \nord=25
     \advance \nord by \b
     \setcounter{nv\romannumeral\nord}{#1}%
    \else
     \ifx #2S
      \setcounter{nvxxxiv}{#1}
     \else
      \ifx #2s
       \setcounter{nvxxxiv}{#1}
      \else
       \setcounter{nvi}{#1}%
      \fi
     \fi
    \fi
   \fi
  \fi
 \fi
}
</pre></body></html>