\documentstyle{article}
% cchessboard.tex
%
% papier 8.5in x 11in = 21.59cm x 27.94cm
% dessin 17.6cm x 19.8cm
%\hoffset=-0.545cm% devrait etre la bonne valeur, mais...!??
\hoffset=-1.545cm

\setlength{\textwidth}{20cm}\setlength{\textheight}{22cm}
\setlength{\oddsidemargin}{0cm}\setlength{\evensidemargin}{0cm}
\setlength{\topmargin}{0cm}\setlength{\headheight}{0cm}

% If the font size is changed, the macro  WhiteMask  must also be changed
\newfont{\EchecsChinois}{cchess46}
\newcounter{piecex}\newcounter{piecey}

\special{! /WhiteMask
 { 
  gsave 
  [] 0 setdash 0 setlinejoin 0 setlinecap 
% the gray level could be changed to 0.95, for light gray pieces that stand out
% better on a white board.  Here, it is set to full white (0.0 is full black).
  1.0 setgray 
% Here, the 102 was determined by trial and error.  Must find an algebraic way to fix it!
% that's the radius of the masking circle.
  102 dup scale 
  currentpoint translate newpath 0. 0. 1. 0. 360. arc closepath fill
  grestore
 } def }

\newcommand{\piece}[3]{%   macro pour afficher une piece
\setcounter{piecex}{#1}\addtocounter{piecex}{-1}%
\setcounter{piecey}{#2}\addtocounter{piecey}{-1}%
\put(\value{piecex},\value{piecey}){\special{" grestore WhiteMask gsave}}%
\put(\value{piecex},\value{piecey})%
{\setbox0=\hbox{\EchecsChinois #3}\kern-0.5\wd0\box0}%
}

\begin{document}
\thispagestyle{empty}
\begin{center}
\setlength{\unitlength}{2.2cm}%
\begin{picture}(8.1,9.1)%
\put(0,0){\framebox(8,9){}}%
\put(-0.05,-0.05){\framebox(8.1,9.1){}}%
%
\newsavebox{\Something}%
\savebox{\Something}(8,1)[bl]{%
\multiput(0,0)(1,0){8}{\framebox(1,1){}}}%
%
\multiput(0,0)(0,1){4}{\usebox{\Something}}%
\multiput(0,5)(0,1){4}{\usebox{\Something}}%
%
\newsavebox{\SW}\newsavebox{\SE}\newsavebox{\NE}\newsavebox{\NW}%
\savebox{\SW}(1,1)[bl]{%
\put(0.1,0.1){\line(1,0){0.2}}\put(0.1,0.1){\line(0,1){0.2}}}%
\savebox{\SE}(1,1)[bl]{%
\put(0.9,0.1){\line(-1,0){0.2}}\put(0.9,0.1){\line(0,1){0.2}}}%
\savebox{\NE}(1,1)[bl]{%
\put(0.9,0.9){\line(-1,0){0.2}}\put(0.9,0.9){\line(0,-1){0.2}}}%
\savebox{\NW}(1,1)[bl]{%
\put(0.1,0.9){\line(1,0){0.2}}\put(0.1,0.9){\line(0,-1){0.2}}}%
% On va commencer par faire les "croix" completes
\savebox{\Something}(2,2)[bl]{%
\put(0,0){\usebox{\NE}}\put(1,0){\usebox{\NW}}\put(1,1){\usebox{\SW}}\put(0,1){\usebox{\SE}}}%
%
\put(0,1){\usebox{\Something}}%
\put(6,1){\usebox{\Something}}%
\put(1,2){\usebox{\Something}}%
\put(3,2){\usebox{\Something}}%
\put(5,2){\usebox{\Something}}%
%
\put(0,6){\usebox{\Something}}%
\put(6,6){\usebox{\Something}}%
\put(1,5){\usebox{\Something}}%
\put(3,5){\usebox{\Something}}%
\put(5,5){\usebox{\Something}}%
% Maintenant les demi-croix gauches
\savebox{\Something}(1,2)[bl]{%
\put(0,0){\usebox{\NW}}\put(0,1){\usebox{\SW}}}%
\put(0,2){\usebox{\Something}}%
\put(0,5){\usebox{\Something}}%
% ...les demi-croix droites
\savebox{\Something}(1,2)[bl]{%
\put(0,0){\usebox{\NE}}\put(0,1){\usebox{\SE}}}%
\put(7,2){\usebox{\Something}}%
\put(7,5){\usebox{\Something}}%
%
% et pour finir, les camps des generaux:
\savebox{\Something}(2,2)[bl]{%
\put(0,0){\line(1,1){2}}% La "longueur" a fournir est celle de la projection horizontale
\put(2,0){\line(-1,1){2}}}%
\put(3,0){\usebox{\Something}}%
\put(3,7){\usebox{\Something}}%
%
\piece{1}{1}{r}\piece{9}{1}{r}%
\piece{2}{1}{n}\piece{8}{1}{n}%
\piece{3}{1}{b}\piece{7}{1}{b}%
\piece{4}{1}{g}\piece{6}{1}{g}%
\piece{2}{3}{c}\piece{8}{3}{c}%
\piece{1}{4}{p}\piece{3}{4}{p}\piece{5}{4}{p}\piece{7}{4}{p}\piece{9}{4}{p}%
\piece{5}{1}{k}%
\piece{1}{10}{R}\piece{9}{10}{R}%
\piece{2}{10}{N}\piece{8}{10}{N}%
\piece{3}{10}{B}\piece{7}{10}{B}%
\piece{4}{10}{G}\piece{6}{10}{G}%
\piece{2}{8}{C}\piece{8}{8}{C}%
\piece{1}{7}{P}\piece{3}{7}{P}\piece{5}{7}{P}\piece{7}{7}{P}\piece{9}{7}{P}%
\piece{5}{10}{K}%
%\piece{4}{5}{0}\put(3.3,4.4){\large Masque}%
\end{picture}
\end{center}
\end{document}
