summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/othelloboard
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/othelloboard
Initial commit
Diffstat (limited to 'macros/latex/contrib/othelloboard')
-rw-r--r--macros/latex/contrib/othelloboard/README26
-rw-r--r--macros/latex/contrib/othelloboard/example-rose-chps1-2.pdfbin0 -> 74250 bytes
-rw-r--r--macros/latex/contrib/othelloboard/example-rose-chps1-2.tex814
-rw-r--r--macros/latex/contrib/othelloboard/othelloboard.pdfbin0 -> 156198 bytes
-rw-r--r--macros/latex/contrib/othelloboard/othelloboard.sty1069
-rw-r--r--macros/latex/contrib/othelloboard/othelloboard.tex760
6 files changed, 2669 insertions, 0 deletions
diff --git a/macros/latex/contrib/othelloboard/README b/macros/latex/contrib/othelloboard/README
new file mode 100644
index 0000000000..53d1e2fade
--- /dev/null
+++ b/macros/latex/contrib/othelloboard/README
@@ -0,0 +1,26 @@
+The othelloboard package allows you to create gorgeous Othello/Reversi board diagrams
+with minimal effort. Diagrams may be any size and support annotations (including
+full game transcripts). Automated board/transcript creation from plain text formats
+standard to WZebra and other programs is also supported.
+
+***************************
+Copyright 2011 Steven Hall
+
+This work may be distributed and/or modified under the conditions of the LaTeX Project
+Public License. The latest version of this license is in http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Steven Hall (stevenhall.uk@gmail.com).
+
+This work consists of the files:
+
+- othelloboard.sty
+- othelloboard.pdf (documentation)
+- othelloboard.tex (source for documentation)
+
+Many thanks to Brian Rose for permission to typeset material from his book Othello: A
+Minute to Learn … A Lifetime to Master in the example file:
+
+- example-rose-chps1-2.pdf \ No newline at end of file
diff --git a/macros/latex/contrib/othelloboard/example-rose-chps1-2.pdf b/macros/latex/contrib/othelloboard/example-rose-chps1-2.pdf
new file mode 100644
index 0000000000..05db871731
--- /dev/null
+++ b/macros/latex/contrib/othelloboard/example-rose-chps1-2.pdf
Binary files differ
diff --git a/macros/latex/contrib/othelloboard/example-rose-chps1-2.tex b/macros/latex/contrib/othelloboard/example-rose-chps1-2.tex
new file mode 100644
index 0000000000..b8766c9897
--- /dev/null
+++ b/macros/latex/contrib/othelloboard/example-rose-chps1-2.tex
@@ -0,0 +1,814 @@
+\documentclass[a4paper,12pt]{book}
+
+\setcounter{secnumdepth}{0} % Switches off numbering for sections a la original book.
+
+%%% PAGE DIMENSIONS %%%
+\usepackage{titlesec}
+\titleformat{\chapter}[display]
+{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
+% removes excessive "before" spacing (the second length argument) in chapter headings (default is 50pt)
+\titlespacing*{\chapter}{0pt}{0pt}{40pt}
+
+\usepackage[inner=2.5cm, outer=3.2cm, bottom=4cm]{geometry}
+\usepackage{setspace}
+%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
+\addtolength{\belowcaptionskip}{-8pt} % Reduce some of the excessive space after figures
+
+\usepackage[labelsep=newline, textfont=it, figurename=Diagram, justification=centering]{caption}
+\newcommand{\jargon}[1]{\textbf{#1}}
+\newcommand{\exercisenum}[1]{\vspace{8pt}\noindent\makebox[2.8cm][l]{\textbf{#1}}}
+\newcommand{\puzzlenum}[1]{\vspace{8pt}\noindent\makebox[2.2cm][l]{\textbf{#1}}}
+\newcommand{\glossitem}[1]{\vspace{8pt}\noindent\textbf{#1}\hspace{6pt}}
+\renewcommand\thefigure{\arabic{chapter}-\arabic{figure}}
+
+\usepackage{wrapfig}
+%\usepackage{qtree}
+%\usepackage{multirow}
+%\usepackage{color}
+%\usepackage{hyperref}
+%\hypersetup{linktocpage}
+%\definecolor{gray}{RGB}{211,211,211}
+
+%%% OTHELLO DIAGRAMS %%%
+\usepackage{othelloboard}
+\let\Oldothellogrid\othellogrid
+\renewcommand{\othellogrid}{\dotmarkings\Oldothellogrid}
+
+% diagram sizes
+\newcommand{\scalefactorthreeup}{0.64}
+\newcommand{\scalefactortwoup}{0.64}
+\newcommand{\scalefactorfourup}{0.48}
+
+%\usepackage{appendix}
+
+%%% TITLE %%%
+% Title given on title page
+
+%% DOCUMENT %%
+
+\begin{document}
+%\frontmatter
+
+%\begin{titlepage}
+%\begin{center}
+%\vspace*{5cm}
+%\Huge{\textbf{Othello}}\\[0.5cm]
+%\LARGE{A Minute to Learn \ldots\ a Lifetime to Master}\\[1cm]
+%\large{\textsc{Brian Rose}}
+%\end{center}
+%\end{titlepage}
+
+%\thispagestyle{empty}
+%\null
+%\vfill
+%\begin{center}
+%\noindent Copyright \copyright\ 2005 by Brian Rose\\
+
+%\noindent\emph{Othello} and \emph{A Minute to Learn \ldots\ A lifetime to Master} are registered trademarks of Anjar Co., \copyright\ 1973, 2004 Anjar Co. All Rights Reserved.
+%\end{center}
+
+%\chapter{Acknowledgements}
+%\tableofcontents
+
+%\chapter{Introduction}
+
+%\mainmatter
+
+%\part{}
+\chapter{Rules and notation}
+Diagram 1-1 shows the standard notation for Othello. The columns are labeled
+`a' through `h' from left to right, and the rows are labeled `1' through `8' from top to
+bottom. In this book, squares will be referenced using a small letter followed by a
+number, e.g., `a1' for the upper-left corner and `h8' for the lower-right corner. Certain
+squares are assigned special letters, which will be capitalized, as shown in Diagram
+1-2. This notation was developed by Othello's inventor, Goro Hasegawa, and remains
+in use today. The B-squares are in the center of the edge, the C-squares are on
+the edge next to the corner, and the A-squares lie between the B-squares and C-squares.
+The X-squares are diagonally adjacent to the corners, with the `X' indicating
+danger.
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\annotationsfirstrow{a1}{b1}{c1}{d1}{e1}{f1}{g1}{h1}
+\annotationssecondrow{a2}{b2}{c2}{d2}{e2}{f2}{g2}{h2}
+\annotationsthirdrow{a3}{b3}{c3}{d3}{e3}{f3}{g3}{h3}
+\annotationsfourthrow{a4}{b4}{c4}{d4}{e4}{f4}{g4}{h4}
+\annotationsfifthrow{a5}{b5}{c5}{d5}{e5}{f5}{g5}{h5}
+\annotationssixthrow{a6}{b6}{c6}{d6}{e6}{f6}{g6}{h6}
+\annotationsseventhrow{a7}{b7}{c7}{d7}{e7}{f7}{g7}{h7}
+\annotationseighthrow{a8}{b8}{c8}{d8}{e8}{f8}{g8}{h8}
+\end{othelloboard}
+\caption{}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\annotationsfirstrow{}{C}{A}{B}{B}{A}{C}{}
+\annotationssecondrow{C}{X}{}{}{}{}{X}{C}
+\annotationsthirdrow{A}{}{}{}{}{}{}{A}
+\annotationsfourthrow{B}{}{}{}{}{}{}{B}
+\annotationsfifthrow{B}{}{}{}{}{}{}{B}
+\annotationssixthrow{A}{}{}{}{}{}{}{A}
+\annotationsseventhrow{C}{X}{}{}{}{}{X}{C}
+\annotationseighthrow{}{C}{A}{B}{B}{A}{C}{}
+\end{othelloboard}
+\caption{Square names}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+Black and White, written with capital letters, will refer to the players, while
+lowercase letters (black and white) will refer to the color of the discs. For example:
+``at the end of the game there were more black discs than white discs, so Black won
+and White lost''. Black and White are referred to as ``he'', although they could of
+course be ``she'', as many women play Othello, including Carol Jacobs, who won the
+U.S. Othello Championship twice in a row.
+
+Compass directions (north, south, east, west) are sometimes used to refer to
+areas of the board (top, bottom, right, and left, respectively).
+
+\section{Rules of the game}
+
+\begin{enumerate}
+\item The game begins with black discs on d5 and e4, and white discs on d4 and e5, as
+shown in Diagram 1-3.
+
+\item Players alternate taking turns, with Black moving first.
+
+\item A legal move consists of placing a new disc on an empty square, and flipping
+one or more of the opponent's discs.
+
+\item Any of the opponent's pieces which are `sandwiched' between the disc just placed
+on the board and a disc of the same color already on the board should be flipped.
+Sandwiches can be formed vertically, horizontally, or diagonally. To form a sandwich,
+all of the squares between the new disc and the disc of the same color
+already on the board must be occupied by the opponent's pieces, with no blank
+squares in between.
+
+\item Pieces may be flipped in several directions on the same move. Any pieces which
+are caught in a sandwich must be flipped; the player moving does not have the
+right to choose to not flip a disc.
+
+\item A new disc can not be played unless at least one of the opponent's discs is
+flipped. If a player has no legal moves, that is, if no matter where the player
+places a new disc he could not flip at least one disc, that player passes his turn,
+and his opponent continues to make consecutive moves until a legal move becomes
+available to that player.
+
+\item If a player has at least one legal move available, he must make a move and may
+not pass his turn.
+
+\item The game continues until the board is completely filled or neither player has a
+legal move.
+\end{enumerate}
+
+\section{Scoring}
+
+Scoring is done at the end of game. The usual way to determine the score is to
+simply count the number of discs of each color, e.g., if there are 34 black discs and 30
+white discs, then Black wins 34--30. If both players have the same number of discs,
+then the game is a draw.
+
+In tournament play, if one player captures all of his opponents discs, the game is
+usually scored as a 64--0 victory for that player, regardless of the number of discs on
+the board. Further, in certain tournaments, such as the World Championship, empty
+squares are awarded to the winner. For example, if at the end of the game there are 32
+black discs and 29 white discs, with 3 empty squares, the score is recorded as a 35--29
+victory for Black.
+
+\section{Examples}
+
+Diagrams 1-4 through 1-9 show a sequence of moves at the start of the game to
+demonstrate the rules. In Diagram 1-4, Black makes the first move of the game to
+f5, sandwiching the white disc on e5 between this new disc and the black disc on
+d5. In the diagram, the numeral 1 on the disc on f5 indicates that this is where the
+first move is played. The diamond-shaped black disc on e5 indicates that this disc
+was white before the move, and was flipped as the result of Black's move. Below
+the diagram, the phrase `White to move' indicates that White will make the next
+move in the game. In Diagram 1-5, White plays to f6, sandwiching the disc on e5
+diagonally using the existing white disc on d4. In Diagram 1-7, White plays to f4,
+flipping discs in two directions. The black disc on f5 is sandwiched between the
+new disc on f4 and the white disc on f6, while the black disc on e4 is sandwiched
+between f4 and d4. In Diagram 1-9, White plays to c5, sandwiching the black discs
+on d5 and e5 using the existing white disc on f5.
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{4}{2}{0}{0}
+\annotationsfifthrow{}{}{}{}{}{1}{}{}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{3}{2}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{0}{0}{1}{0}{0}
+\annotationssixthrow{}{}{}{}{}{2}{}{}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{4}{2}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{0}{2}{1}{0}{0}
+\annotationssixthrow{}{}{}{}{3}{}{}{}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfourthrow{0}{0}{0}{1}{3}{1}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{2}{3}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{0}{2}{1}{0}{0}
+\annotationsfourthrow{}{}{}{}{}{4}{}{}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\othelloarraythirdrow{0}{0}{0}{0}{2}{0}{0}{0}
+\othelloarrayfourthrow{0}{0}{0}{1}{4}{1}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{2}{1}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{0}{2}{1}{0}{0}
+\annotationsthirdrow{}{}{}{}{5}{}{}{}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\othelloarraythirdrow{0}{0}{0}{0}{2}{0}{0}{0}
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow{0}{0}{1}{3}{3}{1}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{0}{2}{1}{0}{0}
+\annotationsfifthrow{}{}{6}{}{}{}{}{}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+Suppose that in the position shown in Diagram 1-10, Black moves to f8. Diagram
+1-11 shows the correct position after this move. The white disc on e6 is completely
+surrounded by black discs, but Black does not get to flip this disc, as it was not
+sandwiched by the move to f8. Diagram 1-12 shows a position in which White does
+not have a legal move. White passes, and Black moves again.
+
+\begin{figure}[h!]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow{0}{0}{0}{2}{2}{2}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{2}{2}{1}{0}{0}
+\othelloarraythirdrow{0}{0}{0}{2}{2}{1}{0}{0}
+\othelloarrayfourthrow{0}{0}{0}{2}{2}{1}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{2}{1}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{2}{1}{1}{0}{0}
+\othelloarrayseventhrow{0}{0}{0}{2}{2}{1}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{2}{0}{0}{0}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+%\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow{0}{0}{0}{2}{2}{2}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{2}{2}{4}{0}{0}
+\othelloarraythirdrow{0}{0}{0}{2}{2}{4}{0}{0}
+\othelloarrayfourthrow{0}{0}{0}{2}{2}{4}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{2}{4}{0}{0}
+\othelloarraysixthrow{0}{0}{0}{2}{1}{4}{0}{0}
+\othelloarrayseventhrow{0}{0}{0}{2}{2}{4}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{2}{2}{0}{0}
+\annotationseighthrow{}{}{}{}{}{1}{}{}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow{0}{0}{1}{2}{2}{2}{2}{2}
+\othelloarraysecondrow {0}{0}{1}{2}{2}{1}{2}{1}
+\othelloarraythirdrow{0}{0}{1}{2}{2}{2}{2}{2}
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{2}{2}{2}
+\othelloarrayfifthrow{0}{0}{1}{2}{2}{2}{2}{2}
+\othelloarraysixthrow{2}{2}{2}{2}{2}{2}{2}{2}
+\othelloarrayseventhrow{2}{2}{2}{2}{2}{2}{2}{2}
+\othelloarrayeighthrow{2}{2}{2}{2}{2}{2}{2}{2}
+\end{othelloboard}
+\caption{White passes}
+\end{minipage}
+\end{center}
+\end{figure}
+
+\section{Playing through a transcript}
+
+Diagram 1-13 shows an example of a transcript of a complete game. The numbers
+indicate the order in which the moves were made, but not which pieces were
+flipped. To replay the game, place a black disc on the square marked 1 (f5 in this
+case), and flip pieces according to the normal rules of the game (e5 should be flipped
+to black in this case). Continue by playing a move for White on the square marked 2,
+a move for Black on the square marked 3, etc. Diagram 1-14 shows the position
+created after move 30, while Diagram 1-15 shows the final position. Partial transcripts
+are sometimes used to indicate a sequence of moves (see Diagram 2-9 for an
+example).
+
+\begin{figure}[h!]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {2}{1}{1}{2}{2}{1}{2}{1}
+\othelloarraysecondrow {1}{1}{2}{1}{1}{1}{2}{1}
+\othelloarraythirdrow {2}{1}{2}{1}{2}{2}{1}{2}
+\othelloarrayfourthrow {2}{1}{2}{1}{2}{1}{2}{1}
+\othelloarrayfifthrow {2}{1}{1}{2}{1}{2}{1}{2}
+\othelloarraysixthrow {1}{2}{2}{1}{2}{1}{2}{2}
+\othelloarrayseventhrow {2}{1}{2}{2}{1}{1}{2}{1}
+\othelloarrayeighthrow {1}{2}{2}{1}{1}{2}{2}{1}
+\annotationsfirstrow {49} {44} {38} {39} {33} {40} {59} {60}
+\annotationssecondrow {46} {48} {31} {42} {10} {12} {47} {52}
+\annotationsthirdrow {29} {20} {27} {22} {5} {11} {36} {51}
+\annotationsfourthrow {45} {34} {7} {} {} {4} {13} {32}
+\annotationsfifthrow {43} {18} {6} {} {} {1} {14} {15}
+\annotationssixthrow {30} {21} {9} {16} {3} {2} {23} {35}
+\annotationsseventhrow{55} {56} {53} {17} {8} {28} {37} {54}
+\annotationseighthrow {58} {57} {25} {24} {26} {19} {41} {50}
+\end{othelloboard}
+\caption{Transcript}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow{0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{0}{1}{1}{0}{0}
+\othelloarraythirdrow{2}{2}{2}{1}{1}{1}{0}{0}
+\othelloarrayfourthrow{0}{0}{2}{2}{2}{1}{2}{0}
+\othelloarrayfifthrow{0}{1}{2}{1}{2}{1}{2}{2}
+\othelloarraysixthrow{1}{3}{1}{1}{1}{1}{2}{0}
+\othelloarrayseventhrow{0}{0}{0}{1}{1}{1}{0}{0}
+\othelloarrayeighthrow {0}{0}{2}{1}{1}{2}{0}{0}
+\annotationssixthrow{30}{}{}{}{}{}{}{}
+\end{othelloboard}
+\caption{After move 30}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow{2}{2}{2}{2}{2}{2}{2}{1}
+\othelloarraysecondrow {2}{2}{1}{1}{1}{2}{1}{1}
+\othelloarraythirdrow{2}{2}{2}{1}{2}{1}{2}{1}
+\othelloarrayfourthrow{2}{2}{2}{2}{1}{1}{2}{1}
+\othelloarrayfifthrow{2}{2}{2}{1}{2}{1}{2}{1}
+\othelloarraysixthrow{2}{2}{1}{2}{2}{2}{1}{1}
+\othelloarrayseventhrow{2}{1}{2}{1}{1}{1}{1}{1}
+\othelloarrayeighthrow{1}{1}{1}{1}{1}{1}{1}{1}
+\end{othelloboard}
+\caption{Final position}
+\end{minipage}
+\end{center}
+\end{figure}
+
+\chapter{Corners and stable discs}
+Perhaps the most basic strategy in Othello is to take the corners. By the rules of
+play, it is impossible to flip a disc in a corner, so that if you are able to take a corner,
+that disc will be yours for the rest of the game. In Diagram 2-1, the disc on h8 must be
+white at the end of the game: even if Black later moves to both g8 and h7, he can not
+capture the disc on h8. Moreover, once you have a corner, it is often possible to build
+a large number of discs that are protected by the corner and can never be flipped.
+Such discs are called \jargon{stable discs}.
+
+\begin{figure}[h!]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\drawboardfromstring{---------------------------OX------OOX-----OOO--------O--------O}
+\end{othelloboard}
+\caption{}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\drawboardfromstring{--------------------O------OO------OOX-----OXX-----XOOO--OOOOOOO}
+\end{othelloboard}
+\caption{}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\drawboardfromstring{---------------O---XXX-O---XXXXO---XXXOO---XXOOO--OOOOOO-OOOOOOO}
+\end{othelloboard}
+\caption{}
+\end{minipage}
+\end{center}
+\end{figure}
+
+In Diagram 2-2, the discs on the bottom row are stable discs, and in Diagram 2-3,
+all 21 white discs are stable discs. If this is not obvious to you, then take some time
+now to convince yourself. Set up the positions on a board, then try to flip the stable
+discs by placing black discs wherever you like. There is simply no way for Black to
+get ``behind'' these discs to surround and flip them. The possibility of building up
+stable discs usually makes corners very valuable, especially early in the game.
+
+If taking corners is that good, then it should be obvious that you usually do not
+want to give any to your opponent! Given the rules of the game, the only way for your
+opponent to take a corner is if you play in one of the squares next to a corner, i.e., the
+C-squares or X-squares. The X-squares are particularly dangerous, and a move to an
+X-square early in the game is almost certain to give up the adjacent corner. For example, in Diagram 2-4, White has just moved to the X-square at g7. Although Black
+can not take the h8 corner immediately, if he can establish even one disc on the c3-f6
+diagonal, then Black will be able take the corner.
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.35\textwidth}
+\begin{othelloboard}{\scalefactortwoup}
+\dotmarkings
+\drawboardfromstring{-----------O-O----OOOOO---OOOOX---OOOOX--XXOXO----XOO3O---XXXXX-}
+\posannotation{g7}{28}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hspace{24pt}
+%\hfill
+\begin{minipage}[t]{.35\textwidth}
+\begin{othelloboard}{\scalefactortwoup}
+\dotmarkings
+\drawboardfromstring{-----------O-O----OOOOO---OOOOX--X4444X--XXOXO----XOOOO---XXXXX-}
+\posannotation{b5}{1}
+
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+One possibility is for Black to play b5, capturing the disc on e5, as shown in
+Diagram 2-5. No matter where White plays, he will not be able to recapture the e5
+disc, and Black will be able to take the h8 corner on his next turn. Once black has the
+corner, all of his discs on row 8 become stable discs, and later in the game he is likely
+to be able to create stable discs on the right edge as well. In general, the earlier in the
+game a corner is taken the more valuable it is, as the potential for building up stable
+discs around the corner is greater. In most cases, moving to an X-square early in the
+game will prove to be a fatal error, although later in the book we will examine some
+exceptional circumstances under which early X-square moves are useful.
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\drawboardfromstring{---------------X--XXXO4O--XXX4O----X4OO---XXXO-------O----------}
+\posannotation{h2}{1}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\drawboardfromstring{-----------XOO-X--XXOO4---XOX4XX--OXXXX----OXX------------------}
+\posannotation{h2}{1}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\drawboardfromstring{-------------X-X----OX4----OOXO----OOXOO---OXX------OX----------}
+\posannotation{h2}{1}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+While moves to the X-square will usually allow the opponent to take the adjacent
+corner, for C-squares the degree of danger depends largely on the rest of the
+squares on the same edge. For example, in Diagrams 2-6, 2-7, and 2-8, Black will
+quickly lose the h1 corner. In Diagram 2-6, White simply takes the corner on the next
+move. In Diagram 2-7, White can play h3; Black has no way of capturing the h3 disc,
+and White will be able to play h1 on his next turn. Can you see the way that White can capture the h1 corner in Diagram 2-8?
+
+Starting from Diagram 2-8, White should play h3, gaining access to the h1 corner.
+Even if Black captures the h3 disc by playing h4, as in Diagram 2-9, White still
+has access to the corner, as shown in Diagram 2-10. As these diagrams suggest, C-squares are often the most dangerous when the adjacent A-square is empty, allowing
+the opponent to attack the corner by playing into the A-square. We will see many
+more examples like this in later chapters.
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.35\textwidth}
+\begin{othelloboard}{\scalefactortwoup}
+\dotmarkings
+\drawboardfromstring{-------------X-X----OXXO---OOXOX---OOXOO---OXX------OX----------}
+\posannotation{h3}{1}
+\posannotation{h4}{2}
+\end{othelloboard}
+\caption{}
+\end{minipage}
+\hspace{24pt}
+%\hfill
+\begin{minipage}[t]{.35\textwidth}
+\begin{othelloboard}{\scalefactortwoup}
+\dotmarkings
+\drawboardfromstring{-------------X-X----OOXX---OOXXX---OOXXO---OXX------OX----------}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+While there are many circumstances under which C-squares are bad moves, they are quite often perfectly good moves, and frequently they involve no danger of giving up a corner despite being adjacent to it. Diagrams 2-11, 2-12, and 2-13 all show examples where Black has a good C-square move at h2. In Diagram 2-11, h2 builds on Black's stable discs, and offers no prospect of white taking the h1 corner. In Diagram 2-12, Black must play h2 to prevent White from capturing the h8 corner. Once he does so, he is in no immediate danger of losing a corner. In Diagram 2-13, black can play h2 and later play another C-square at h7, all with no danger of losing a corner. As these diagrams suggest, the best time to take a C-square is often when you have pieces of your own color in the other squares along the edge.
+\addtolength{\belowcaptionskip}{-8pt}
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{.6}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{1}{0}{1}{0}{0}
+\othelloarraythirdrow {0}{0}{1}{1}{1}{1}{1}{2}
+\othelloarrayfourthrow {0}{1}{1}{1}{1}{1}{2}{2}
+\othelloarrayfifthrow {1}{1}{1}{2}{2}{2}{2}{2}
+\othelloarraysixthrow {0}{2}{2}{1}{2}{2}{1}{2}
+\othelloarrayseventhrow {0}{0}{2}{2}{2}{1}{2}{2}
+\othelloarrayeighthrow {0}{0}{2}{2}{2}{2}{2}{2}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{.6}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{0}{0}{1}{0}{0}
+\othelloarraythirdrow {0}{0}{0}{1}{2}{1}{1}{1}
+\othelloarrayfourthrow {0}{0}{0}{2}{2}{2}{1}{2}
+\othelloarrayfifthrow {0}{0}{2}{2}{2}{2}{1}{2}
+\othelloarraysixthrow {0}{0}{2}{2}{2}{1}{2}{2}
+\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{2}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{.6}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{0}{2}{2}{2}{1}{1}{1}
+\othelloarrayfourthrow {0}{0}{2}{2}{2}{2}{2}{2}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{1}{1}{2}
+\othelloarraysixthrow {0}{0}{0}{1}{1}{1}{1}{2}
+\othelloarrayseventhrow {0}{0}{0}{0}{1}{1}{0}{2}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+\clearpage
+\section*{Exercises}
+\addtolength{\belowcaptionskip}{8pt}
+\captionsetup{figurename=Exercise}\setcounter{figure}{0}
+In each diagram, find the best move. Answers begin on page \pageref{answersc2}.
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{2}{0}{0}{2}{0}
+\othelloarraysecondrow {0}{0}{2}{2}{2}{2}{2}{0}
+\othelloarraythirdrow {2}{2}{2}{2}{2}{2}{2}{1}
+\othelloarrayfourthrow {2}{2}{2}{2}{2}{1}{2}{0}
+\othelloarrayfifthrow {2}{2}{2}{2}{1}{2}{2}{0}
+\othelloarraysixthrow {2}{2}{2}{2}{2}{2}{2}{0}
+\othelloarrayseventhrow {2}{0}{0}{0}{0}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {0}{1}{1}{1}{1}{1}{1}{0}
+\othelloarraysecondrow {0}{0}{1}{1}{1}{1}{1}{1}
+\othelloarraythirdrow {2}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayfourthrow {2}{2}{1}{1}{1}{1}{1}{1}
+\othelloarrayfifthrow {2}{2}{1}{1}{2}{1}{1}{1}
+\othelloarraysixthrow {2}{2}{1}{1}{1}{1}{1}{1}
+\othelloarrayseventhrow {2}{0}{2}{2}{1}{2}{0}{1}
+\othelloarrayeighthrow {0}{2}{2}{2}{2}{2}{2}{0}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{2}{2}{2}{2}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{2}{2}{2}{0}{0}
+\othelloarraythirdrow {0}{0}{2}{2}{2}{2}{0}{0}
+\othelloarrayfourthrow {0}{2}{2}{1}{2}{2}{0}{0}
+\othelloarrayfifthrow {0}{2}{1}{2}{1}{2}{0}{0}
+\othelloarraysixthrow {0}{2}{2}{2}{2}{2}{0}{0}
+\othelloarrayseventhrow {0}{1}{1}{1}{1}{1}{0}{0}
+\othelloarrayeighthrow {1}{1}{1}{1}{1}{1}{1}{0}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarraythirdrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayfourthrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayfifthrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarraysixthrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayseventhrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayeighthrow {2}{2}{2}{2}{2}{2}{1}{0}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {0}{1}{1}{1}{0}{1}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{1}{1}{1}{0}{0}
+\othelloarraythirdrow {0}{0}{1}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{0}{1}{1}{2}{2}{2}{0}
+\othelloarrayfifthrow {0}{0}{1}{1}{2}{2}{2}{0}
+\othelloarraysixthrow {0}{0}{1}{1}{2}{2}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{1}{2}{2}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{2}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{0}{2}{2}{1}{0}{2}
+\othelloarraythirdrow {0}{0}{2}{2}{2}{1}{2}{2}
+\othelloarrayfourthrow {0}{0}{2}{2}{2}{2}{2}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{2}{2}{1}{0}
+\othelloarraysixthrow {0}{0}{0}{1}{2}{0}{0}{1}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+\chapter{Frontier discs and walls}
+\captionsetup{figurename=Diagram}
+
+In chapter 2, we learned about the value of corners, and the danger of moving to
+X-squares and C-squares. While knowing this alone might be enough to let you win
+against a complete novice, it will not get you far against more seasoned competition.
+In games between players that are both aware of the strategies presented in chapter 2,
+neither player will voluntarily make the sort of bad X-square and C-squares moves
+that give up corners for no reason. If you want your opponent to make these moves,
+then you will have to force him to do so. That is, you want to create a situation where
+the \emph{only} moves available to your opponent are bad moves. How to go about doing this
+is the subject of this chapter, and indeed most of the rest of the book.
+
+\begin{figure}[h]
+\begin{center}
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarraythirdrow {0}{2}{2}{2}{2}{2}{1}{1}
+\othelloarrayfourthrow {2}{2}{2}{2}{2}{2}{1}{0}
+\othelloarrayfifthrow {0}{1}{2}{2}{1}{1}{1}{2}
+\othelloarraysixthrow {1}{1}{1}{1}{1}{1}{1}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarraythirdrow {1}{3}{3}{3}{3}{3}{1}{1}
+\othelloarrayfourthrow {2}{3}{2}{2}{2}{2}{1}{0}
+\othelloarrayfifthrow {0}{1}{3}{2}{1}{1}{1}{2}
+\othelloarraysixthrow {1}{1}{1}{1}{1}{1}{1}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{1}{0}{0}{0}
+\posannotation{a3}{1}
+\end{othelloboard}
+\caption{Black to move}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{.32\textwidth}
+\begin{othelloboard}{\scalefactorthreeup}
+\dotmarkings
+\othelloarraysecondrow {2}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {4}{4}{1}{1}{1}{1}{1}{1}
+\othelloarrayfourthrow {2}{1}{2}{2}{2}{2}{1}{0}
+\othelloarrayfifthrow {0}{1}{1}{2}{1}{1}{1}{2}
+\othelloarraysixthrow {1}{1}{1}{1}{1}{1}{1}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{1}{0}{0}{0}
+\posannotation{a2}{2}
+\end{othelloboard}
+\caption{White to move}
+\end{minipage}
+\end{center}
+\end{figure}
+
+Diagram 3-1 shows the sort of position that often arises in games between an
+expert (Black) and a novice (White). Many novices choose their moves mainly on the
+basis of the number of discs that are flipped, with the more discs flipped the better.
+After all, the object of the game is to end up with as many pieces as possible, so it
+seems logical to want to take a lot of pieces at every point during the game. Following
+this logic, the novice chooses to play a3, flipping 7 discs, as shown in Diagram 3-2.
+The problem with this move becomes apparent after Black replies with a2, resulting
+in the position shown in Diagram 3-3.
+
+In Diagram 3-3, White's only legal option is the b2 X-square, which White is
+obliged to play whether he wants to or not (Diagram 3-4). This immediately surrenders
+the a1 corner (Diagram 3-5), and Black will eventually gain many \ldots
+
+%% Answers %%
+
+\chapter*{Answers to Exercises}
+\label{answersc2}
+\subsection*{Chapter 2}
+\exercisenum{Exercise 2-1} White should play e1, capturing the disc at e4, which will provide access to the h2 corner.
+
+\exercisenum{Exercise 2-2} Black should play a2. Although this is a C-square, there is no
+danger of White gaining access to the a1 corner. Further, this move flips the
+disc at d5, which will allow Black to take the h1 corner.
+
+\exercisenum{Exercise 2-3} White should play a7, using the a8 corner to build more stable
+discs.
+
+\exercisenum{Exercise 2-4} This is an extreme example of building up stable discs. The
+correct sequence of moves is shown in the diagram.
+
+\begin{center}
+\begin{othelloboard}{.8}
+\othelloarrayfirstrow {2}{2}{2}{2}{2}{2}{2}{2}
+\othelloarraysecondrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarraythirdrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayfourthrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayfifthrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarraysixthrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayseventhrow {1}{1}{1}{1}{1}{1}{1}{1}
+\othelloarrayeighthrow {2}{2}{2}{2}{2}{2}{1}{2}
+\annotationsfirstrow {1}{2}{3}{4}{5}{6}{8}{9}
+\posannotation{h8}{7}
+\end{othelloboard}
+\end{center}
+
+\exercisenum{Exercise 2-5} Black should fill in the hole at e1. Since White can not capture
+this disc, Black will be able to take the a1 corner.
+
+\exercisenum{Exercise 2-6} White should play h4, threatening to take the h1 corner. If Black
+tries to prevent this by playing h5, the white disc at h6 still allows White to take
+the corner.
+
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/othelloboard/othelloboard.pdf b/macros/latex/contrib/othelloboard/othelloboard.pdf
new file mode 100644
index 0000000000..aedd0be159
--- /dev/null
+++ b/macros/latex/contrib/othelloboard/othelloboard.pdf
Binary files differ
diff --git a/macros/latex/contrib/othelloboard/othelloboard.sty b/macros/latex/contrib/othelloboard/othelloboard.sty
new file mode 100644
index 0000000000..e2bf8e2cd6
--- /dev/null
+++ b/macros/latex/contrib/othelloboard/othelloboard.sty
@@ -0,0 +1,1069 @@
+%% othelloboard.sty
+ %% Copyright 2011 Steven Hall
+ %
+ % This work may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is Steven Hall.
+ %
+ % This work consists of the files othelloboard.sty and othelloboard.pdf
+
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{othelloboard}[2011/18/08 Othello board diagram drawing package by Steven Hall]
+\RequirePackage{graphicx}
+\RequirePackage{pict2e}
+\RequirePackage{ifthen}
+\RequirePackage{color}
+\RequirePackage{xstring}
+\RequirePackage{stringstrings}
+
+
+%%%%%%%%%%%%%%%%%%%%
+%%OTHELLO DIAGRAMS MACROS%%
+%%%%%%%%%%%%%%%%%%%%
+
+
+%------Main commands for individual discs-------%
+\newcommand{\blackdisc}{\circle*{20.4}}
+\newcommand{\whitedisc}{\circle{20}}
+\newcommand{\whitediamond}{\makebox(0,0){\rotatebox{45}{\framebox(13.3,13.3){}}}}
+\newcommand{\blackdiamond}{\makebox(0,0){\rotatebox{45}{\rule{14.12pt}{14.12pt}}}}
+
+
+%------Conditional command depending on value of a single argument. 1=white disc, 2=black disc, 3=white diamond, 4=black diamond, 0=no disc. Other numbers give no disc by default.
+\newcommand{\othellodisc}[1]{%
+\ifthenelse{#1=0}{}{}%
+\ifthenelse{#1=1}{\whitedisc}{}%
+\ifthenelse{#1=2}{\blackdisc}{}%
+\ifthenelse{#1=3}{\whitediamond}{}%
+\ifthenelse{#1=4}{\blackdiamond}{}%
+}%
+
+%-------Declare all the counters to be used to store value inputted for each square. Only called upon to determine the text colour of annotations (white text if value=2 or 4, otherwise normal text).
+\newcounter{disccolouraa} \newcounter{disccolourab} \newcounter{disccolourac}
+\newcounter{disccolourad} \newcounter{disccolourae} \newcounter{disccolouraf}
+\newcounter{disccolourag} \newcounter{disccolourah} \newcounter{disccolourba}
+\newcounter{disccolourbb} \newcounter{disccolourbc} \newcounter{disccolourbd}
+\newcounter{disccolourbe} \newcounter{disccolourbf} \newcounter{disccolourbg}
+\newcounter{disccolourbh} \newcounter{disccolourca} \newcounter{disccolourcb}
+\newcounter{disccolourcc} \newcounter{disccolourcd} \newcounter{disccolource}
+\newcounter{disccolourcf} \newcounter{disccolourcg} \newcounter{disccolourch}
+\newcounter{disccolourda} \newcounter{disccolourdb} \newcounter{disccolourdc}
+\newcounter{disccolourdd} \newcounter{disccolourde} \newcounter{disccolourdf}
+\newcounter{disccolourdg} \newcounter{disccolourdh} \newcounter{disccolourea}
+\newcounter{disccoloureb} \newcounter{disccolourec} \newcounter{disccoloured}
+\newcounter{disccolouree} \newcounter{disccolouref} \newcounter{disccoloureg}
+\newcounter{disccoloureh} \newcounter{disccolourfa} \newcounter{disccolourfb}
+\newcounter{disccolourfc} \newcounter{disccolourfd} \newcounter{disccolourfe}
+\newcounter{disccolourff} \newcounter{disccolourfg} \newcounter{disccolourfh}
+\newcounter{disccolourga} \newcounter{disccolourgb} \newcounter{disccolourgc}
+\newcounter{disccolourgd} \newcounter{disccolourge} \newcounter{disccolourgf}
+\newcounter{disccolourgg} \newcounter{disccolourgh} \newcounter{disccolourha}
+\newcounter{disccolourhb} \newcounter{disccolourhc} \newcounter{disccolourhd}
+\newcounter{disccolourhe} \newcounter{disccolourhf} \newcounter{disccolourhg}
+\newcounter{disccolourhh}
+%
+
+%----- Need a command to reset all counters.----
+\newcommand{\resetalldisccolours}{
+\setcounter{disccolouraa}{0}\setcounter{disccolourab}{0}\setcounter{disccolourac}{0}
+\setcounter{disccolourad}{0}\setcounter{disccolourae}{0}\setcounter{disccolouraf}{0}
+\setcounter{disccolourag}{0}\setcounter{disccolourah}{0}\setcounter{disccolourba}{0}
+\setcounter{disccolourbb}{0}\setcounter{disccolourbc}{0}\setcounter{disccolourbd}{0}
+\setcounter{disccolourbe}{0}\setcounter{disccolourbf}{0}\setcounter{disccolourbg}{0}
+\setcounter{disccolourbh}{0}\setcounter{disccolourca}{0}\setcounter{disccolourcb}{0}
+\setcounter{disccolourcc}{0}\setcounter{disccolourcd}{0}\setcounter{disccolource}{0}
+\setcounter{disccolourcf}{0}\setcounter{disccolourcg}{0}\setcounter{disccolourch}{0}
+\setcounter{disccolourda}{0}\setcounter{disccolourdb}{0}\setcounter{disccolourdc}{0}
+\setcounter{disccolourdd}{0}\setcounter{disccolourde}{0}\setcounter{disccolourdf}{0}
+\setcounter{disccolourdg}{0}\setcounter{disccolourdh}{0}\setcounter{disccolourea}{0}
+\setcounter{disccoloureb}{0}\setcounter{disccolourec}{0}\setcounter{disccoloured}{0}
+\setcounter{disccolouree}{0}\setcounter{disccolouref}{0}\setcounter{disccoloureg}{0}
+\setcounter{disccoloureh}{0}\setcounter{disccolourfa}{0}\setcounter{disccolourfb}{0}
+\setcounter{disccolourfc}{0}\setcounter{disccolourfd}{0}\setcounter{disccolourfe}{0}
+\setcounter{disccolourff}{0}\setcounter{disccolourfg}{0}\setcounter{disccolourfh}{0}
+\setcounter{disccolourga}{0}\setcounter{disccolourgb}{0}\setcounter{disccolourgc}{0}
+\setcounter{disccolourgd}{0}\setcounter{disccolourge}{0}\setcounter{disccolourgf}{0}
+\setcounter{disccolourgg}{0}\setcounter{disccolourgh}{0}\setcounter{disccolourha}{0}
+\setcounter{disccolourhb}{0}\setcounter{disccolourhc}{0}\setcounter{disccolourhd}{0}
+\setcounter{disccolourhe}{0}\setcounter{disccolourhf}{0}\setcounter{disccolourhg}{0}
+\setcounter{disccolourhh}{0}}
+
+%------- Colour commands for annotations text ------------
+% Centres inputted annotation string for each square within a 20pt wide box. Text can spill outside the box and remains centred. Two commands, one for white, one for normal (typically black) text.
+\newcommand{\othellowhitetext}[1]{\makebox[20pt]{\textcolor{white}{#1}}}
+\newcommand{\othellonormaltext}[1]{\makebox[20pt]{#1}}
+
+% Conditional command that is used within each \annotations...row command. Takes two arguments. The first determines which of the two commands defined just above to execute (the white text command if arg is 2 or 4, black text command otherwise). The second argument is the string that gets fed into either the white text or black text command. The second argument is inputted by the user. The first string is going to be taken from the value of a disccolour... counter.
+\newcommand{\othelloannotation}[2]{%
+\ifthenelse{#1=2 \or #1=4}%
+{\othellowhitetext{#2}}%
+{\othellonormaltext{#2}}%
+}
+
+
+%-------Individual rows of the array. (LaTeX only takes up to 9 arguments in a \newcommand definition)
+% Discs/diamonds are placed horizontally and vertically at 24-unit intervals. Diameter 20 units.
+
+%----First Row (from the top, left to right)-----%
+\newcommand{\othelloarrayfirstrow}[8]%
+{%
+\put(12,180){\othellodisc{#1}} \setcounter{disccolouraa}{#1}% Places disc/diamond at a1 and stores value in counters declared above.
+\put(36,180){\othellodisc{#2}} \setcounter{disccolourba}{#2}
+\put(60,180){\othellodisc{#3}} \setcounter{disccolourca}{#3}
+\put(84,180){\othellodisc{#4}} \setcounter{disccolourda}{#4}
+\put(108,180){\othellodisc{#5}} \setcounter{disccolourea}{#5}
+\put(132,180){\othellodisc{#6}} \setcounter{disccolourfa}{#6}
+\put(156,180){\othellodisc{#7}} \setcounter{disccolourga}{#7}
+\put(180,180){\othellodisc{#8}} \setcounter{disccolourha}{#8}
+}
+%------Second Row--------%
+\newcommand{\othelloarraysecondrow}[8]%
+{%
+\put(12,156){\othellodisc{#1}} \setcounter{disccolourab}{#1}
+\put(36,156){\othellodisc{#2}} \setcounter{disccolourbb}{#2}
+\put(60,156){\othellodisc{#3}} \setcounter{disccolourcb}{#3}
+\put(84,156){\othellodisc{#4}} \setcounter{disccolourdb}{#4}
+\put(108,156){\othellodisc{#5}} \setcounter{disccoloureb}{#5}
+\put(132,156){\othellodisc{#6}} \setcounter{disccolourfb}{#6}
+\put(156,156){\othellodisc{#7}} \setcounter{disccolourgb}{#7}
+\put(180,156){\othellodisc{#8}} \setcounter{disccolourhb}{#8}
+}
+%-------Third Row-----%
+\newcommand{\othelloarraythirdrow}[8]%
+{%
+\put(12,132){\othellodisc{#1}} \setcounter{disccolourac}{#1}
+\put(36,132){\othellodisc{#2}} \setcounter{disccolourbc}{#2}
+\put(60,132){\othellodisc{#3}} \setcounter{disccolourcc}{#3}
+\put(84,132){\othellodisc{#4}} \setcounter{disccolourdc}{#4}
+\put(108,132){\othellodisc{#5}} \setcounter{disccolourec}{#5}
+\put(132,132){\othellodisc{#6}} \setcounter{disccolourfc}{#6}
+\put(156,132){\othellodisc{#7}} \setcounter{disccolourgc}{#7}
+\put(180,132){\othellodisc{#8}} \setcounter{disccolourhc}{#8}
+}
+%-------Fourth Row-----%
+\newcommand{\othelloarrayfourthrow}[8]%
+{%
+\put(12,108){\othellodisc{#1}} \setcounter{disccolourad}{#1}
+\put(36,108){\othellodisc{#2}} \setcounter{disccolourbd}{#2}
+\put(60,108){\othellodisc{#3}} \setcounter{disccolourcd}{#3}
+\put(84,108){\othellodisc{#4}} \setcounter{disccolourdd}{#4}
+\put(108,108){\othellodisc{#5}} \setcounter{disccoloured}{#5}
+\put(132,108){\othellodisc{#6}} \setcounter{disccolourfd}{#6}
+\put(156,108){\othellodisc{#7}} \setcounter{disccolourgd}{#7}
+\put(180,108){\othellodisc{#8}}\setcounter{disccolourhd}{#8}
+}
+%-------Fifth Row-----%
+\newcommand{\othelloarrayfifthrow}[8]%
+{%
+\put(12,84){\othellodisc{#1}} \setcounter{disccolourae}{#1}
+\put(36,84){\othellodisc{#2}} \setcounter{disccolourbe}{#2}
+\put(60,84){\othellodisc{#3}} \setcounter{disccolource}{#3}
+\put(84,84){\othellodisc{#4}} \setcounter{disccolourde}{#4}
+\put(108,84){\othellodisc{#5}} \setcounter{disccolouree}{#5}
+\put(132,84){\othellodisc{#6}} \setcounter{disccolourfe}{#6}
+\put(156,84){\othellodisc{#7}} \setcounter{disccolourge}{#7}
+\put(180,84){\othellodisc{#8}} \setcounter{disccolourhe}{#8}
+}
+%-------Sixth Row-----%
+\newcommand{\othelloarraysixthrow}[8]%
+{%
+\put(12,60){\othellodisc{#1}} \setcounter{disccolouraf}{#1}
+\put(36,60){\othellodisc{#2}} \setcounter{disccolourbf}{#2}
+\put(60,60){\othellodisc{#3}} \setcounter{disccolourcf}{#3}
+\put(84,60){\othellodisc{#4}} \setcounter{disccolourdf}{#4}
+\put(108,60){\othellodisc{#5}} \setcounter{disccolouref}{#5}
+\put(132,60){\othellodisc{#6}} \setcounter{disccolourff}{#6}
+\put(156,60){\othellodisc{#7}} \setcounter{disccolourgf}{#7}
+\put(180,60){\othellodisc{#8}} \setcounter{disccolourhf}{#8}
+}
+%-------Seventh Row-----%
+\newcommand{\othelloarrayseventhrow}[8]%
+{%
+\put(12,36){\othellodisc{#1}} \setcounter{disccolourag}{#1}
+\put(36,36){\othellodisc{#2}} \setcounter{disccolourbg}{#2}
+\put(60,36){\othellodisc{#3}} \setcounter{disccolourcg}{#3}
+\put(84,36){\othellodisc{#4}} \setcounter{disccolourdg}{#4}
+\put(108,36){\othellodisc{#5}} \setcounter{disccoloureg}{#5}
+\put(132,36){\othellodisc{#6}} \setcounter{disccolourfg}{#6}
+\put(156,36){\othellodisc{#7}} \setcounter{disccolourgg}{#7}
+\put(180,36){\othellodisc{#8}} \setcounter{disccolourhg}{#8}
+}
+%-------Eighth Row-----%
+\newcommand{\othelloarrayeighthrow}[8]%
+{%
+\put(12,12){\othellodisc{#1}} \setcounter{disccolourah}{#1}
+\put(36,12){\othellodisc{#2}} \setcounter{disccolourbh}{#2}
+\put(60,12){\othellodisc{#3}} \setcounter{disccolourch}{#3}
+\put(84,12){\othellodisc{#4}} \setcounter{disccolourdh}{#4}
+\put(108,12){\othellodisc{#5}} \setcounter{disccoloureh}{#5}
+\put(132,12){\othellodisc{#6}} \setcounter{disccolourfh}{#6}
+\put(156,12){\othellodisc{#7}} \setcounter{disccolourgh}{#7}
+\put(180,12){\othellodisc{#8}} \setcounter{disccolourhh}{#8}
+}
+
+
+%----Annotations Row by Row-----%
+%----First Row (from the top, left to right)-----%
+\newcommand{\annotationsfirstrow}[8]%
+{%
+\put(2,176.5){\othelloannotation{\value{disccolouraa}}{#1}} %Places text at a1 in white or normal font according to colour of the disc at that square. Calls upon counter value set when the disc was placed.
+\put(26,176.5){\othelloannotation{\value{disccolourba}}{#2}}
+\put(50,176.5){\othelloannotation{\value{disccolourca}}{#3}}
+\put(74,176.5){\othelloannotation{\value{disccolourda}}{#4}}
+\put(98,176.5){\othelloannotation{\value{disccolourea}}{#5}}
+\put(122,176.5){\othelloannotation{\value{disccolourfa}}{#6}}
+\put(146,176.5){\othelloannotation{\value{disccolourga}}{#7}}
+\put(170,176.5){\othelloannotation{\value{disccolourha}}{#8}}
+}
+%----Second Row------%
+\newcommand{\annotationssecondrow}[8]%
+{%
+\put(2,152.5){\othelloannotation{\value{disccolourab}}{#1}} \put(26,152.5){\othelloannotation{\value{disccolourbb}}{#2}} \put(50,152.5){\othelloannotation{\value{disccolourcb}}{#3}} \put(74,152.5){\othelloannotation{\value{disccolourdb}}{#4}} \put(98,152.5){\othelloannotation{\value{disccoloureb}}{#5}} \put(122,152.5){\othelloannotation{\value{disccolourfb}}{#6}} \put(146,152.5){\othelloannotation{\value{disccolourgb}}{#7}} \put(170,152.5){\othelloannotation{\value{disccolourhb}}{#8}}
+}
+%----Third Row------%
+\newcommand{\annotationsthirdrow}[8]%
+{%
+\put(2,128.5){\othelloannotation{\value{disccolourac}}{#1}} \put(26,128.5){\othelloannotation{\value{disccolourbc}}{#2}} \put(50,128.5){\othelloannotation{\value{disccolourcc}}{#3}} \put(74,128.5){\othelloannotation{\value{disccolourdc}}{#4}} \put(98,128.5){\othelloannotation{\value{disccolourec}}{#5}} \put(122,128.5){\othelloannotation{\value{disccolourfc}}{#6}} \put(146,128.5){\othelloannotation{\value{disccolourgc}}{#7}} \put(170,128.5){\othelloannotation{\value{disccolourhc}}{#8}}
+}
+%----Fourth Row-----%
+\newcommand{\annotationsfourthrow}[8]
+{%
+\put(2,104.5){\othelloannotation{\value{disccolourad}}{#1}} \put(26,104.5){\othelloannotation{\value{disccolourbd}}{#2}} \put(50,104.5){\othelloannotation{\value{disccolourcd}}{#3}} \put(74,104.5){\othelloannotation{\value{disccolourdd}}{#4}} \put(98,104.5){\othelloannotation{\value{disccoloured}}{#5}} \put(122,104.5){\othelloannotation{\value{disccolourfd}}{#6}} \put(146,104.5){\othelloannotation{\value{disccolourgd}}{#7}} \put(170,104.5){\othelloannotation{\value{disccolourhd}}{#8}}
+}
+%----Fifth Row-----%
+\newcommand{\annotationsfifthrow}[8]
+{%
+\put(2,80.5){\othelloannotation{\value{disccolourae}}{#1}} \put(26,80.5){\othelloannotation{\value{disccolourbe}}{#2}} \put(50,80.5){\othelloannotation{\value{disccolource}}{#3}} \put(74,80.5){\othelloannotation{\value{disccolourde}}{#4}} \put(98,80.5){\othelloannotation{\value{disccolouree}}{#5}} \put(122,80.5){\othelloannotation{\value{disccolourfe}}{#6}} \put(146,80.5){\othelloannotation{\value{disccolourge}}{#7}} \put(170,80.5){\othelloannotation{\value{disccolourhe}}{#8}}
+}
+%----Sixth Row-----%
+\newcommand{\annotationssixthrow}[8]
+{
+\put(2,56.5){\othelloannotation{\value{disccolouraf}}{#1}} \put(26,56.5){\othelloannotation{\value{disccolourbf}}{#2}} \put(50,56.5){\othelloannotation{\value{disccolourcf}}{#3}} \put(74,56.5){\othelloannotation{\value{disccolourdf}}{#4}}\put(98,56.5){\othelloannotation{\value{disccolouref}}{#5}}\put(122,56.5){\othelloannotation{\value{disccolourff}}{#6}}\put(146,56.5){\othelloannotation{\value{disccolourgf}}{#7}}\put(170,56.5){\othelloannotation{\value{disccolourhf}}{#8}}
+}
+%----Seventh Row-----%
+\newcommand{\annotationsseventhrow}[8]%
+{%
+\put(2,32.5){\othelloannotation{\value{disccolourag}}{#1}} \put(26,32.5){\othelloannotation{\value{disccolourbg}}{#2}} \put(50,32.5){\othelloannotation{\value{disccolourcg}}{#3}} \put(74,32.5){\othelloannotation{\value{disccolourdg}}{#4}} \put(98,32.5){\othelloannotation{\value{disccoloureg}}{#5}} \put(122,32.5){\othelloannotation{\value{disccolourfg}}{#6}} \put(146,32.5){\othelloannotation{\value{disccolourgg}}{#7}} \put(170,32.5){\othelloannotation{\value{disccolourhg}}{#8}}
+}
+%----Eighth Row-----%
+\newcommand{\annotationseighthrow}[8]%
+{%
+\put(2,8.5){\othelloannotation{\value{disccolourah}}{#1}} \put(26,8.5){\othelloannotation{\value{disccolourbh}}{#2}} \put(50,8.5){\othelloannotation{\value{disccolourch}}{#3}} \put(74,8.5){\othelloannotation{\value{disccolourdh}}{#4}} \put(98,8.5){\othelloannotation{\value{disccoloureh}}{#5}} \put(122,8.5){\othelloannotation{\value{disccolourfh}}{#6}} \put(146,8.5){\othelloannotation{\value{disccolourgh}}{#7}} \put(170,8.5){\othelloannotation{\value{disccolourhh}}{#8}}
+}
+
+%-----Grids-------%
+\newcommand{\othellogrid}{%
+% outside edges first, slightly thicker
+\thicklines
+\put(0,0){\line(0,1){192}}
+\put(192,0){\line(0,1){192}}
+\put(0,0){\line(1,0){192}}
+\put(0,192){\line(1,0){192}}
+% inside lines
+\thinlines
+\put(24,0){\line(0,1){192}}
+\put(48,0){\line(0,1){192}}
+\put(72,0){\line(0,1){192}}
+\put(96,0){\line(0,1){192}}
+\put(120,0){\line(0,1){192}}
+\put(144,0){\line(0,1){192}}
+\put(168,0){\line(0,1){192}}
+\put(0,24){\line(1,0){192}}
+\put(0,48){\line(1,0){192}}
+\put(0,72){\line(1,0){192}}
+\put(0,96){\line(1,0){192}}
+\put(0,120){\line(1,0){192}}
+\put(0,144){\line(1,0){192}}
+\put(0,168){\line(1,0){192}}
+}
+
+%Initially included dot markings (on the inner corners of each x-square) as part of the \othellogrid command, but people may prefer to leave them out. So there's a separate command to put them in.
+%-------Dot markings-------
+\newcommand{\dotmarkings}{%
+\put(48,48){\circle*{2.4}}
+\put(48,144){\circle*{2.4}}
+\put(144,144){\circle*{2.4}}
+\put(144,48){\circle*{2.4}}
+}
+
+
+%------Row and Column Labels-----%
+%Diagrams in some places, e.g. the British Othello Federation newsletter, leave off grid references.
+%Note the co-ordinates here are given relative to the picture box that contains the grid, which is 192x192 units and places bounding lines at (0,0)(left edge and bottom edge), (0,192)(top edge), and (192,0)(right edge). The co-ordinates below all fall *outside* this box. This seems like the neatest way of keeping the grid as a separate module from the grid labels. To ensure the labels, when used, don't bleed into the text surrounding a board diagram the grid is housed inside of a larger, 208x208 unit, box as part of the othelloboard environment.
+\newcommand{\gridrefs}{%
+\put(-10,10){\footnotesize{8}}
+\put(-10,34){\footnotesize{7}}
+\put(-10,58){\footnotesize{6}}
+\put(-10,82){\footnotesize{5}}
+\put(-10,106){\footnotesize{4}}
+\put(-10,130){\footnotesize{3}}
+\put(-10,154){\footnotesize{2}}
+\put(-10,178){\footnotesize{1}}
+\put(9.5,197){\footnotesize{a}}
+\put(33.5,197){\footnotesize{b}}
+\put(57.5,197){\footnotesize{c}}
+\put(81.5,197){\footnotesize{d}}
+\put(105.5,197){\footnotesize{e}}
+\put(129.5,197){\footnotesize{f}}
+\put(153.5,197){\footnotesize{g}}
+\put(177.5,197){\footnotesize{h}}
+}
+
+%-------Define Environments to shorten the code required for each diagram-------
+% To be used with \lrbox to work around environment definition restrictions on having unclosed braces in the begin code.
+\newsavebox{\fmboard}%
+
+% Instead of a counter to work around inability to use argument values for an environment definition in the end code, and the inability to pass counter values set in the begin code on to the end code.
+\newcommand{\scalefactor}{1}%
+
+% The othelloboard environment
+% The use of \frame is to put a clean border around the board, with definite corners. The way that LaTeX draws lines means that orthogonal lines from the same point don't form a nice corner. This starts to be noticeable with larger boards.
+\newenvironment{othelloboard}[1]%
+{\renewcommand{\scalefactor}{#1} \begin{lrbox}{\fmboard}\begin{picture}(192,192)\resetalldisccolours \othellogrid \gridrefs}
+{\end{picture} \end{lrbox} \scalebox{\scalefactor}{\begin{picture}(208,208)(-16,0) \frame{\usebox{\fmboard}} \end{picture}}}
+
+%The othelloboardnorefs environment
+\newenvironment{othelloboardnorefs}[1]%
+{\renewcommand{\scalefactor}{#1} \begin{lrbox}{\fmboard}\begin{picture}(192,192)\resetalldisccolours \othellogrid}
+{\end{picture} \end{lrbox} \scalebox{\scalefactor}{\begin{picture}(192,192)(0,0) \frame{\usebox{\fmboard}} \end{picture}}}
+
+
+%---- Commands used in the appendix of the documentation, in the example of counting discs using disccolourxy counters.
+\newcounter{numberwdiscs}% counter used in the following command for totting up the number of white discs
+\newcommand{\countwhitediscs}{% If the value of the disccolour counter at a square is 1, increment numberwdiscs, otherwise do nothing
+\ifthenelse{\equal{\value{disccolouraa}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourab}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourac}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourad}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourae}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolouraf}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourag}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourah}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourba}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbc}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbd}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbe}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbf}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbh}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourca}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcc}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcd}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolource}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcf}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourch}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourda}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdc}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdd}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourde}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdf}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdh}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourea}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloureb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourec}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloured}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolouree}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolouref}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloureg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloureh}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfa}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfc}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfd}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfe}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourff}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfh}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourga}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgc}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgd}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourge}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgf}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgh}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourha}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhb}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhc}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhd}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhe}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhf}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhg}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhh}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+}
+
+
+\newcounter{numberbdiscs}
+\newcommand{\countblackdiscs}{%
+\ifthenelse{\equal{\value{disccolouraa}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourab}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourac}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourad}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourae}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolouraf}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourag}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourah}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourba}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbc}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbd}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbe}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbf}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourbh}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourca}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcc}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcd}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolource}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcf}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourcg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourch}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourda}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdc}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdd}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourde}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdf}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourdh}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourea}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloureb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourec}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloured}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolouree}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolouref}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloureg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccoloureh}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfa}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfc}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfd}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfe}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourff}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourfh}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourga}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgc}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgd}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourge}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgf}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourgh}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourha}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhb}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhc}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhd}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhe}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhf}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhg}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourhh}}{2}}{\addtocounter{numberbdiscs}{1}}{}
+}
+
+
+%----- Command for placing annotations according to square name. Puts '#2' at square #1.
+\newcommand{\posannotation}[2]{%
+\ifthenelse{\equal{#1}{A1} \OR \equal{#1}{a1}}{\put(2,176.5){\othelloannotation{\value{disccolouraa}}{#2}}}{}
+\ifthenelse{\equal{#1}{B1} \OR \equal{#1}{b1}}{\put(26,176.5){\othelloannotation{\value{disccolourba}}{#2}}}{}
+\ifthenelse{\equal{#1}{C1} \OR \equal{#1}{c1}}{\put(50,176.5){\othelloannotation{\value{disccolourca}}{#2}}}{}
+\ifthenelse{\equal{#1}{D1} \OR \equal{#1}{d1}}{\put(74,176.5){\othelloannotation{\value{disccolourda}}{#2}}}{}
+\ifthenelse{\equal{#1}{E1} \OR \equal{#1}{e1}}{\put(98,176.5){\othelloannotation{\value{disccolourea}}{#2}}}{}
+\ifthenelse{\equal{#1}{F1} \OR \equal{#1}{f1}}{\put(122,176.5){\othelloannotation{\value{disccolourfa}}{#2}}}{}
+\ifthenelse{\equal{#1}{G1} \OR \equal{#1}{g1}}{\put(146,176.5){\othelloannotation{\value{disccolourga}}{#2}}}{}
+\ifthenelse{\equal{#1}{H1} \OR \equal{#1}{h1}}{\put(170,176.5){\othelloannotation{\value{disccolourha}}{#2}}}{}
+\ifthenelse{\equal{#1}{A2} \OR \equal{#1}{a2}}{\put(2,152.5){\othelloannotation{\value{disccolourab}}{#2}}}{}
+\ifthenelse{\equal{#1}{B2} \OR \equal{#1}{b2}}{\put(26,152.5){\othelloannotation{\value{disccolourbb}}{#2}}}{}
+\ifthenelse{\equal{#1}{C2} \OR \equal{#1}{c2}}{\put(50,152.5){\othelloannotation{\value{disccolourcb}}{#2}}}{}
+\ifthenelse{\equal{#1}{D2} \OR \equal{#1}{d2}}{\put(74,152.5){\othelloannotation{\value{disccolourdb}}{#2}}}{}
+\ifthenelse{\equal{#1}{E2} \OR \equal{#1}{e2}}{\put(98,152.5){\othelloannotation{\value{disccoloureb}}{#2}}}{}
+\ifthenelse{\equal{#1}{F2} \OR \equal{#1}{f2}}{\put(122,152.5){\othelloannotation{\value{disccolourfb}}{#2}}}{}
+\ifthenelse{\equal{#1}{G2} \OR \equal{#1}{g2}}{\put(146,152.5){\othelloannotation{\value{disccolourgb}}{#2}}}{}
+\ifthenelse{\equal{#1}{H2} \OR \equal{#1}{h2}}{\put(170,152.5){\othelloannotation{\value{disccolourhb}}{#2}}}{}
+\ifthenelse{\equal{#1}{A3} \OR \equal{#1}{a3}}{\put(2,128.5){\othelloannotation{\value{disccolourac}}{#2}}}{}
+\ifthenelse{\equal{#1}{B3} \OR \equal{#1}{b3}}{\put(26,128.5){\othelloannotation{\value{disccolourbc}}{#2}}}{}
+\ifthenelse{\equal{#1}{C3} \OR \equal{#1}{c3}}{\put(50,128.5){\othelloannotation{\value{disccolourcc}}{#2}}}{}
+\ifthenelse{\equal{#1}{D3} \OR \equal{#1}{d3}}{\put(74,128.5){\othelloannotation{\value{disccolourdc}}{#2}}}{}
+\ifthenelse{\equal{#1}{E3} \OR \equal{#1}{e3}}{\put(98,128.5){\othelloannotation{\value{disccolourec}}{#2}}}{}
+\ifthenelse{\equal{#1}{F3} \OR \equal{#1}{f3}}{\put(122,128.5){\othelloannotation{\value{disccolourfc}}{#2}}}{}
+\ifthenelse{\equal{#1}{G3} \OR \equal{#1}{g3}}{\put(146,128.5){\othelloannotation{\value{disccolourgc}}{#2}}}{}
+\ifthenelse{\equal{#1}{H3} \OR \equal{#1}{h3}}{\put(170,128.5){\othelloannotation{\value{disccolourhc}}{#2}}}{}
+\ifthenelse{\equal{#1}{A4} \OR \equal{#1}{a4}}{\put(2,104.5){\othelloannotation{\value{disccolourad}}{#2}}}{}
+\ifthenelse{\equal{#1}{B4} \OR \equal{#1}{b4}}{\put(26,104.5){\othelloannotation{\value{disccolourbd}}{#2}}}{}
+\ifthenelse{\equal{#1}{C4} \OR \equal{#1}{c4}}{\put(50,104.5){\othelloannotation{\value{disccolourcd}}{#2}}}{}
+\ifthenelse{\equal{#1}{D4} \OR \equal{#1}{d4}}{\put(74,104.5){\othelloannotation{\value{disccolourdd}}{#2}}}{}
+\ifthenelse{\equal{#1}{E4} \OR \equal{#1}{e4}}{\put(98,104.5){\othelloannotation{\value{disccoloured}}{#2}}}{}
+\ifthenelse{\equal{#1}{F4} \OR \equal{#1}{f4}}{\put(122,104.5){\othelloannotation{\value{disccolourfd}}{#2}}}{}
+\ifthenelse{\equal{#1}{G4} \OR \equal{#1}{g4}}{\put(146,104.5){\othelloannotation{\value{disccolourgd}}{#2}}}{}
+\ifthenelse{\equal{#1}{H4} \OR \equal{#1}{h4}}{\put(170,104.5){\othelloannotation{\value{disccolourhd}}{#2}}}{}
+\ifthenelse{\equal{#1}{A5} \OR \equal{#1}{a5}}{\put(2,80.5){\othelloannotation{\value{disccolourae}}{#2}}}{}
+\ifthenelse{\equal{#1}{B5} \OR \equal{#1}{b5}}{\put(26,80.5){\othelloannotation{\value{disccolourbe}}{#2}}}{}
+\ifthenelse{\equal{#1}{C5} \OR \equal{#1}{c5}}{\put(50,80.5){\othelloannotation{\value{disccolource}}{#2}}}{}
+\ifthenelse{\equal{#1}{D5} \OR \equal{#1}{d5}}{\put(74,80.5){\othelloannotation{\value{disccolourde}}{#2}}}{}
+\ifthenelse{\equal{#1}{E5} \OR \equal{#1}{e5}}{\put(98,80.5){\othelloannotation{\value{disccolouree}}{#2}}}{}
+\ifthenelse{\equal{#1}{F5} \OR \equal{#1}{f5}}{\put(122,80.5){\othelloannotation{\value{disccolourfe}}{#2}}}{}
+\ifthenelse{\equal{#1}{G5} \OR \equal{#1}{g5}}{\put(146,80.5){\othelloannotation{\value{disccolourge}}{#2}}}{}
+\ifthenelse{\equal{#1}{H5} \OR \equal{#1}{h5}}{\put(170,80.5){\othelloannotation{\value{disccolourhe}}{#2}}}{}
+\ifthenelse{\equal{#1}{A6} \OR \equal{#1}{a6}}{\put(2,56.5){\othelloannotation{\value{disccolouraf}}{#2}}}{}
+\ifthenelse{\equal{#1}{B6} \OR \equal{#1}{b6}}{\put(26,56.5){\othelloannotation{\value{disccolourbf}}{#2}}}{}
+\ifthenelse{\equal{#1}{C6} \OR \equal{#1}{c6}}{\put(50,56.5){\othelloannotation{\value{disccolourcf}}{#2}}}{}
+\ifthenelse{\equal{#1}{D6} \OR \equal{#1}{d6}}{\put(74,56.5){\othelloannotation{\value{disccolourdf}}{#2}}}{}
+\ifthenelse{\equal{#1}{E6} \OR \equal{#1}{e6}}{\put(98,56.5){\othelloannotation{\value{disccolouref}}{#2}}}{}
+\ifthenelse{\equal{#1}{F6} \OR \equal{#1}{f6}}{\put(122,56.5){\othelloannotation{\value{disccolourff}}{#2}}}{}
+\ifthenelse{\equal{#1}{G6} \OR \equal{#1}{g6}}{\put(146,56.5){\othelloannotation{\value{disccolourgf}}{#2}}}{}
+\ifthenelse{\equal{#1}{H6} \OR \equal{#1}{h6}}{\put(170,56.5){\othelloannotation{\value{disccolourhf}}{#2}}}{}
+\ifthenelse{\equal{#1}{A7} \OR \equal{#1}{a7}}{\put(2,32.5){\othelloannotation{\value{disccolourag}}{#2}}}{}
+\ifthenelse{\equal{#1}{B7} \OR \equal{#1}{b7}}{\put(26,32.5){\othelloannotation{\value{disccolourbg}}{#2}}}{}
+\ifthenelse{\equal{#1}{C7} \OR \equal{#1}{c7}}{\put(50,32.5){\othelloannotation{\value{disccolourcg}}{#2}}}{}
+\ifthenelse{\equal{#1}{D7} \OR \equal{#1}{d7}}{\put(74,32.5){\othelloannotation{\value{disccolourdg}}{#2}}}{}
+\ifthenelse{\equal{#1}{E7} \OR \equal{#1}{e7}}{\put(98,32.5){\othelloannotation{\value{disccoloureg}}{#2}}}{}
+\ifthenelse{\equal{#1}{F7} \OR \equal{#1}{f7}}{\put(122,32.5){\othelloannotation{\value{disccolourfg}}{#2}}}{}
+\ifthenelse{\equal{#1}{G7} \OR \equal{#1}{g7}}{\put(146,32.5){\othelloannotation{\value{disccolourgg}}{#2}}}{}
+\ifthenelse{\equal{#1}{H7} \OR \equal{#1}{h7}}{\put(170,32.5){\othelloannotation{\value{disccolourhg}}{#2}}}{}
+\ifthenelse{\equal{#1}{A8} \OR \equal{#1}{a8}}{\put(2,8.5){\othelloannotation{\value{disccolourah}}{#2}}}{}
+\ifthenelse{\equal{#1}{B8} \OR \equal{#1}{b8}}{\put(26,8.5){\othelloannotation{\value{disccolourbh}}{#2}}}{}
+\ifthenelse{\equal{#1}{C8} \OR \equal{#1}{c8}}{\put(50,8.5){\othelloannotation{\value{disccolourch}}{#2}}}{}
+\ifthenelse{\equal{#1}{D8} \OR \equal{#1}{d8}}{\put(74,8.5){\othelloannotation{\value{disccolourdh}}{#2}}}{}
+\ifthenelse{\equal{#1}{E8} \OR \equal{#1}{e8}}{\put(98,8.5){\othelloannotation{\value{disccoloureh}}{#2}}}{}
+\ifthenelse{\equal{#1}{F8} \OR \equal{#1}{f8}}{\put(122,8.5){\othelloannotation{\value{disccolourfh}}{#2}}}{}
+\ifthenelse{\equal{#1}{G8} \OR \equal{#1}{g8}}{\put(146,8.5){\othelloannotation{\value{disccolourgh}}{#2}}}{}
+\ifthenelse{\equal{#1}{H8} \OR \equal{#1}{h8}}{\put(170,8.5){\othelloannotation{\value{disccolourhh}}{#2}}}{}
+}
+
+%---- Automated transcript creation
+%---- Command for taking two characters at a time and writing a number at the square represented by the character pair, starting with 1.
+
+\newcommand{\drawtranscript}[1]{%
+\noblanks[q]{#1}%
+ \StrMid{\thestring}{1}{2}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{1}
+ \StrMid{\thestring}{3}{4}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{2}
+ \StrMid{\thestring}{5}{6}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{3}
+ \StrMid{\thestring}{7}{8}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{4}
+ \StrMid{\thestring}{9}{10}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{5}
+ \StrMid{\thestring}{11}{12}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{6}
+ \StrMid{\thestring}{13}{14}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{7}
+ \StrMid{\thestring}{15}{16}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{8}
+ \StrMid{\thestring}{17}{18}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{9}
+ \StrMid{\thestring}{19}{20}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{10}
+ \StrMid{\thestring}{21}{22}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{11}
+ \StrMid{\thestring}{23}{24}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{12}
+ \StrMid{\thestring}{25}{26}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{13}
+ \StrMid{\thestring}{27}{28}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{14}
+ \StrMid{\thestring}{29}{30}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{15}
+ \StrMid{\thestring}{31}{32}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{16}
+ \StrMid{\thestring}{33}{34}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{17}
+ \StrMid{\thestring}{35}{36}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{18}
+ \StrMid{\thestring}{37}{38}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{19}
+ \StrMid{\thestring}{39}{40}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{20}
+ \StrMid{\thestring}{41}{42}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{21}
+ \StrMid{\thestring}{43}{44}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{22}
+ \StrMid{\thestring}{45}{46}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{23}
+ \StrMid{\thestring}{47}{48}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{24}
+ \StrMid{\thestring}{49}{50}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{25}
+ \StrMid{\thestring}{51}{52}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{26}
+ \StrMid{\thestring}{53}{54}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{27}
+ \StrMid{\thestring}{55}{56}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{28}
+ \StrMid{\thestring}{57}{58}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{29}
+ \StrMid{\thestring}{59}{60}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{30}
+ \StrMid{\thestring}{61}{62}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{31}
+ \StrMid{\thestring}{63}{64}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{32}
+ \StrMid{\thestring}{65}{66}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{33}
+ \StrMid{\thestring}{67}{68}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{34}
+ \StrMid{\thestring}{69}{70}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{35}
+ \StrMid{\thestring}{71}{72}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{36}
+ \StrMid{\thestring}{73}{74}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{37}
+ \StrMid{\thestring}{75}{76}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{38}
+ \StrMid{\thestring}{77}{78}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{39}
+ \StrMid{\thestring}{79}{80}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{40}
+ \StrMid{\thestring}{81}{82}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{41}
+ \StrMid{\thestring}{83}{84}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{42}
+ \StrMid{\thestring}{85}{86}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{43}
+ \StrMid{\thestring}{87}{88}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{44}
+ \StrMid{\thestring}{89}{90}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{45}
+ \StrMid{\thestring}{91}{92}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{46}
+ \StrMid{\thestring}{93}{94}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{47}
+ \StrMid{\thestring}{95}{96}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{48}
+ \StrMid{\thestring}{97}{98}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{49}
+ \StrMid{\thestring}{99}{100}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{50}
+ \StrMid{\thestring}{101}{102}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{51}
+ \StrMid{\thestring}{103}{104}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{52}
+ \StrMid{\thestring}{105}{106}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{53}
+ \StrMid{\thestring}{107}{108}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{54}
+ \StrMid{\thestring}{109}{110}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{55}
+ \StrMid{\thestring}{111}{112}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{56}
+ \StrMid{\thestring}{113}{114}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{57}
+ \StrMid{\thestring}{115}{116}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{58}
+ \StrMid{\thestring}{117}{118}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{59}
+ \StrMid{\thestring}{119}{120}[\mytwochars]%
+ \expandafter\posannotation\expandafter{\mytwochars}{60}
+ }
+
+%------------Commands for drawing discs according to whether argument is dash, O or X. Now draws diamonds for 3 and 4 as argument too.
+\newcommand{\othellodiscfromstring}[1]{%
+\ifthenelse{\equal{#1}{-}}{}{}%
+\ifthenelse{\equal{#1}{O} \or \equal{#1}{o}}{\whitedisc}{}%
+\ifthenelse{\equal{#1}{X} \or \equal{#1}{x}}{\blackdisc}{}%
+\ifthenelse{\equal{#1}{3}}{\whitediamond}{}%
+\ifthenelse{\equal{#1}{4}}{\blackdiamond}{}%
+}
+
+%----- Command for automated board creation from string of Os, Xs and -s. Sets values for each disccolourxy counter as well.
+\newcommand{\drawboardfromstring}[1]{%
+\StrMid{#1}{1}{1}[\mychar]%
+ \put(12,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolouraa}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolouraa}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolouraa}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolouraa}{4}}{}%
+\StrMid{#1}{2}{2}[\mychar]%
+ \put(36,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourba}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourba}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourba}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourba}{4}}{}%
+\StrMid{#1}{3}{3}[\mychar]%
+ \put(60,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourca}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourca}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourca}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourca}{4}}{}%
+\StrMid{#1}{4}{4}[\mychar]%
+ \put(84,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourda}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourda}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourda}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourda}{4}}{}%
+\StrMid{#1}{5}{5}[\mychar]%
+ \put(108,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourea}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourea}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourea}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourea}{4}}{}%
+\StrMid{#1}{6}{6}[\mychar]%
+ \put(132,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfa}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfa}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfa}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfa}{4}}{}%
+\StrMid{#1}{7}{7}[\mychar]%
+ \put(156,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourga}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourga}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourga}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourga}{4}}{}%
+\StrMid{#1}{8}{8}[\mychar]%
+ \put(180,180){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourha}{2}}{}%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourha}{1}}{}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourha}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourha}{4}}{}%
+\StrMid{#1}{9}{9}[\mychar]%
+ \put(12,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourab}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourab}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourab}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourab}{4}}{}%
+\StrMid{#1}{10}{10}[\mychar]%
+ \put(36,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbb}{4}}{}%
+\StrMid{#1}{11}{11}[\mychar]%
+ \put(60,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourcb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourcb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourcb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourcb}{4}}{}%
+\StrMid{#1}{12}{12}[\mychar]%
+ \put(84,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourdb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourdb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourdb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourdb}{4}}{}%
+\StrMid{#1}{13}{13}[\mychar]%
+ \put(108,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccoloureb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccoloureb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccoloureb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccoloureb}{4}}{}%
+\StrMid{#1}{14}{14}[\mychar]%
+ \put(132,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfb}{4}}{}%
+\StrMid{#1}{15}{15}[\mychar]%
+ \put(156,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourgb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourgb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourgb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourgb}{4}}{}%
+\StrMid{#1}{16}{16}[\mychar]%
+ \put(180,156){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhb}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhb}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhb}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhb}{4}}{}%
+\StrMid{#1}{17}{17}[\mychar]%
+ \put(12,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourac}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourac}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourac}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourac}{4}}{}%
+\StrMid{#1}{18}{18}[\mychar]%
+ \put(36,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbc}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbc}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbc}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbc}{4}}{}%
+\StrMid{#1}{19}{19}[\mychar]%
+ \put(60,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourcc}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourcc}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourcc}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourcc}{4}}{}%
+\StrMid{#1}{20}{20}[\mychar]%
+ \put(84,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourdc}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourdc}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourdc}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourdc}{4}}{}%
+\StrMid{#1}{21}{21}[\mychar]%
+ \put(108,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourec}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourec}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourec}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourec}{4}}{}%
+\StrMid{#1}{22}{22}[\mychar]%
+ \put(132,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfc}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfc}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfc}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfc}{4}}{}%
+\StrMid{#1}{23}{23}[\mychar]%
+ \put(156,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourgc}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourgc}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourgc}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourgc}{4}}{}%
+\StrMid{#1}{24}{24}[\mychar]%
+ \put(180,132){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhc}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhc}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhc}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhc}{4}}{}%
+\StrMid{#1}{25}{25}[\mychar]%
+ \put(12,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourad}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourad}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourad}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourad}{4}}{}%
+\StrMid{#1}{26}{26}[\mychar]%
+ \put(36,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbd}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbd}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbd}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbd}{4}}{}%
+\StrMid{#1}{27}{27}[\mychar]%
+ \put(60,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourcd}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourcd}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourcd}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourcd}{4}}{}%
+\StrMid{#1}{28}{28}[\mychar]%
+ \put(84,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourdd}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourdd}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourdd}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourdd}{4}}{}%
+\StrMid{#1}{29}{29}[\mychar]%
+ \put(108,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccoloured}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccoloured}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccoloured}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccoloured}{4}}{}%
+\StrMid{#1}{30}{30}[\mychar]%
+ \put(132,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfd}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfd}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfd}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfd}{4}}{}%
+\StrMid{#1}{31}{31}[\mychar]%
+ \put(156,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourgd}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourgd}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourgd}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourgd}{4}}{}%
+\StrMid{#1}{32}{32}[\mychar]%
+ \put(180,108){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhd}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhd}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhd}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhd}{4}}{}%
+\StrMid{#1}{33}{33}[\mychar]%
+ \put(12,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourae}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourae}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourae}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourae}{4}}{}%
+\StrMid{#1}{34}{34}[\mychar]%
+ \put(36,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbe}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbe}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbe}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbe}{4}}{}%
+\StrMid{#1}{35}{35}[\mychar]%
+ \put(60,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolource}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolource}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolource}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolource}{4}}{}%
+\StrMid{#1}{36}{36}[\mychar]%
+ \put(84,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourde}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourde}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourde}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourde}{4}}{}%
+\StrMid{#1}{37}{37}[\mychar]%
+ \put(108,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolouree}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolouree}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolouree}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolouree}{4}}{}%
+\StrMid{#1}{38}{38}[\mychar]%
+ \put(132,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfe}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfe}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfe}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfe}{4}}{}%
+\StrMid{#1}{39}{39}[\mychar]%
+ \put(156,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourge}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourge}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourge}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourge}{4}}{}%
+\StrMid{#1}{40}{40}[\mychar]%
+ \put(180,84){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhe}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhe}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhe}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhe}{4}}{}%
+\StrMid{#1}{41}{41}[\mychar]%
+ \put(12,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolouraf}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolouraf}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolouraf}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolouraf}{4}}{}%
+\StrMid{#1}{42}{42}[\mychar]%
+ \put(36,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbf}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbf}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbf}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbf}{4}}{}%
+\StrMid{#1}{43}{43}[\mychar]%
+ \put(60,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourcf}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourcf}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourcf}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourcf}{4}}{}%
+\StrMid{#1}{44}{44}[\mychar]%
+ \put(84,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourdf}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourdf}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourdf}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourdf}{4}}{}%
+\StrMid{#1}{45}{45}[\mychar]%
+ \put(108,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolouref}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolouref}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolouref}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolouref}{4}}{}%
+\StrMid{#1}{46}{46}[\mychar]%
+ \put(132,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourff}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourff}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourff}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourff}{4}}{}%
+\StrMid{#1}{47}{47}[\mychar]%
+ \put(156,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourgf}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourgf}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourgf}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourgf}{4}}{}%
+\StrMid{#1}{48}{48}[\mychar]%
+ \put(180,60){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhf}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhf}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhf}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhf}{4}}{}%
+\StrMid{#1}{49}{49}[\mychar]%
+ \put(12,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourag}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourag}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourag}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourag}{4}}{}%
+\StrMid{#1}{50}{50}[\mychar]%
+ \put(36,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbg}{4}}{}%
+\StrMid{#1}{51}{51}[\mychar]%
+ \put(60,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourcg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourcg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourcg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourcg}{4}}{}%
+\StrMid{#1}{52}{52}[\mychar]%
+ \put(84,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourdg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourdg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourdg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourdg}{4}}{}%
+\StrMid{#1}{53}{53}[\mychar]%
+ \put(108,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccoloureg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccoloureg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccoloureg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccoloureg}{4}}{}%
+\StrMid{#1}{54}{54}[\mychar]%
+ \put(132,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfg}{4}}{}%
+\StrMid{#1}{55}{55}[\mychar]%
+ \put(156,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourgg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourgg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourgg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourgg}{4}}{}%
+\StrMid{#1}{56}{56}[\mychar]%
+ \put(180,36){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhg}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhg}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhg}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhg}{4}}{}%
+\StrMid{#1}{57}{57}[\mychar]%
+ \put(12,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourah}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourah}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourah}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourah}{4}}{}%
+\StrMid{#1}{58}{58}[\mychar]%
+ \put(36,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourbh}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourbh}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourbh}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourbh}{4}}{}%
+\StrMid{#1}{59}{59}[\mychar]%
+ \put(60,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourch}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourch}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourch}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourch}{4}}{}%
+\StrMid{#1}{60}{60}[\mychar]%
+ \put(84,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourdh}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourdh}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourdh}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourdh}{4}}{}%
+\StrMid{#1}{61}{61}[\mychar]%
+ \put(108,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccoloureh}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccoloureh}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccoloureh}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccoloureh}{4}}{}%
+\StrMid{#1}{62}{62}[\mychar]%
+ \put(132,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourfh}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourfh}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourfh}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourfh}{4}}{}%
+\StrMid{#1}{63}{63}[\mychar]%
+ \put(156,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourgh}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourgh}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourgh}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourgh}{4}}{}%
+\StrMid{#1}{64}{64}[\mychar]%
+ \put(180,12){\expandafter\othellodiscfromstring\expandafter{\mychar}}%
+ \ifthenelse{\equal{\mychar}{X} \OR \equal{\mychar}{x}}{\setcounter{disccolourhh}{2}}{%
+ \ifthenelse{\equal{\mychar}{O} \OR \equal{\mychar}{o}}{\setcounter{disccolourhh}{1}}{}}%
+ \ifthenelse{\equal{\mychar}{3}}{\setcounter{disccolourhh}{3}}{}%
+ \ifthenelse{\equal{\mychar}{4}}{\setcounter{disccolourhh}{4}}{}%
+} \ No newline at end of file
diff --git a/macros/latex/contrib/othelloboard/othelloboard.tex b/macros/latex/contrib/othelloboard/othelloboard.tex
new file mode 100644
index 0000000000..aab722e802
--- /dev/null
+++ b/macros/latex/contrib/othelloboard/othelloboard.tex
@@ -0,0 +1,760 @@
+\documentclass[a4paper,12pt]{article}
+
+\pagestyle{plain}
+\usepackage{fullpage}
+\usepackage{moreverb}
+\usepackage{wrapfig}
+\usepackage{multicol}
+\usepackage{appendix}
+\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
+\usepackage{othelloboard}
+\usepackage{hyperref}
+%\usepackage{natbib}
+
+
+%%% TITLE %%%
+\newcommand{\fileversion}{v1.2}
+\title{The \textsf{othelloboard} package%
+\thanks{This document corresponds to \textsf{othelloboard}~\fileversion. Thanks to Brian Rose for permission to typeset material from his book for the example file: \texttt{example-rose-chps1-2.pdf}.}
+}\author{Steven Hall \\ \texttt{stevenhall.uk@gmail.com}}
+\date{18 August 2011}
+
+
+%% DOCUMENT %%
+
+\begin{document}
+\pagestyle{plain}
+
+\maketitle
+\tableofcontents
+
+%------
+\section{Drawing a simple board diagram}
+\begin{center}
+\begin{othelloboard}{1}
+\gridrefs
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{1}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{1}{1}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboard}
+\end{center}
+
+The board above was produced by the following list of commands:
+ \begin{verbatimtab}
+ \begin{othelloboard}{1}
+ \dotmarkings
+ \othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+ \othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+ \othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+ \othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+ \othelloarrayfifthrow {0}{0}{2}{2}{1}{1}{0}{0}
+ \othelloarraysixthrow {0}{0}{2}{1}{1}{1}{0}{0}
+ \othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
+ \othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+ \end{othelloboard}
+\end{verbatimtab}
+
+Try copying this block of code into your own document and typesetting it. Make sure you include \verb=\usepackage{othelloboard}= somewhere in your preamble.
+
+Try replacing any of the \verb=0=s, \verb=1=s and \verb=2=s in the array with any number \verb=0=--\verb=4=. You should see that each number has the following effect (\verb=0= has no effect):
+
+\label{disckey}~\begin{tabular}{l c l l c l}
+\verb=1= & draws a white disc: & \begin{picture}(20,20) \put(10,5){\circle{20}} \end{picture} & \hspace{24pt} \verb=3= & draws a white diamond: & \begin{picture}(20,20) \put(10,5){\whitediamond} \end{picture} \\
+\verb=2= & draws a black disc: & \begin{picture}(20,20) \put(10,5){\circle*{20}} \end{picture} & \hspace{24pt} \verb=4= & draws a black diamond: & \begin{picture}(20,20) \put(10,5){\blackdiamond} \end{picture} \\
+\end{tabular}\\
+
+You should also see that where you choose to put a number in the grid determines where on the Othello board it appears. The \textsf{othelloboard} package has been designed to make creating a board diagram as intuitive and simple as possible, so the position of numbers in the array corresponds to exactly the squares you would expect in the diagram. Changing the `\verb=2=' to a `\verb=1=' e.g.\ in the second row of numbers in the code replaces the black disc on c2 with a white one.
+
+\subsection{The \texttt{othelloboard} environment}
+\subsubsection{The basic commands}
+
+Look again at the opening and closing lines of code for the diagram in the previous section.
+
+\begin{description}
+\item{\verb=\begin{othelloboard}{1}=} \verb=% = Mandatory argument for board size.
+\item \ldots
+\item{\verb=\end{othelloboard}=}
+\end{description}
+
+The board diagram was created by entering a series of commands inside of an \verb=othelloboard= environment. The mandatory argument at the end of the \verb=\begin= environment declaration specifies the size of board. Any size at all is possible without loss of detail in the diagram. The board diagram above was set with default value of 1. A value between 0 and 1 produces a smaller board, while a value greater than 1 produces a larger board.
+
+\begin{description}
+\item{\verb=\dotmarkings=} produces the tiny marker dots on the inside corners of the X-squares. The command can be deleted or commented out if you don't want the dots.
+\end{description}
+
+Next, the array of discs on the board is drawn by eight separate commands, one for each row. E.g.\ row three is drawn by this command:
+\begin{description}
+\item{\verb=\othelloarraythirdrow{0}{1}{2}{2}{2}{0}{0}{0}=} The command takes eight arguments, one for each square on the third row, a3--h3. The possible values of each argument are \verb=0=, \verb=1=, \verb=2=, \verb=3=, \verb=4= (with effects described at the top of this page).
+\end{description}
+
+If you don't wish to draw any discs at all for a particular row, it is not necessary to include the command for that row. We could easily, e.g., have omitted the first and eighth row commands in our diagram in the previous section (rather than give the command with a just series of \verb=0=s as arguments).
+
+Here is a board drawn at size 0.75 without \verb=\dotmarkings=, and with the \verb=\othelloarray=\ldots\verb=row= commands for the first and eighth rows omitted:\\
+\begin{tabular}{ll}
+\begin{othelloboard}{0.75}
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{4}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{4}{4}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{2}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboard}
+ &
+\begin{minipage}[b]{320pt}
+\begin{verbatimtab}
+\begin{othelloboard}{0.75}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{4}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{4}{4}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{2}{0}{0}{0}
+\end{othelloboard}
+\end{verbatimtab}
+\ \\
+\end{minipage}\\
+\end{tabular}
+\ \\
+Note the use of black diamonds to show the discs just flipped by the black disc placed at e7. This is the convention followed, e.g., in Brian Rose's book (Rose 2005).
+
+\paragraph{Useful tip}\label{tabtips}
+You may find that it helps see where you are putting discs if you align all of the rows of numbers in the array. You can do this (as with the examples given in this document) by putting tabs between the command name and its first argument. Don't use spaces though, as unlike tabs (which aren't read as gaps when the file compiles), spaces will break the commands and cause errors.
+
+\verb=\othelloarrayfirstrow= \begin{picture}(30,30)\put(20,8){\vector(-1,-2){5}}\put(0,12){\textit{tabs not spaces}}\end{picture}\verb= {0}{1}{1}{2}{1}{0}{0}{0}=\\
+
+\subsection{The \texttt{othelloboardnorefs} environment}
+\label{norefs}
+If you don't want grid reference labels along the top and left edges, you can use the \verb=othelloboardnorefs= environment instead of the \verb=othelloboard= environment. The commands that work inside of the environment are all the same as before, but the outside boundaries of the diagram will be the edges of the 8$\times$8 grid. Our opening example, changing only the environment, gives this output:
+
+\begin{minipage}[t]{196pt}
+\vspace{0pt}
+\begin{othelloboardnorefs}{1}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{1}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{1}{1}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboardnorefs}
+\end{minipage}
+\begin{minipage}[t]{360pt}
+\vspace{12pt}
+\begin{small}
+\begin{verbatimtab}
+\begin{othelloboardnorefs}{1}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{1}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{1}{1}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+\end{othelloboardnorefs}
+\end{verbatimtab}
+\end{small}
+\end{minipage}
+
+A standard-size \verb=othelloboard= diagram produces a 208pt$\times$208pt box containing a 192pt$\times$192pt board with grid labels in 16pt margins at the top and left side. A standard-size \verb=othelloboardnorefs= diagram produces a 192pt$\times$192pt box containing just the board (see Appendix \ref{appendix:layout}).
+
+\section{Annotations}
+You may want to add some annotations to some of the squares, perhaps for move numbers or to indicate possible moves at a particular point in a game.\\
+\begin{minipage}[t]{212pt}
+\vspace{0pt}
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{2}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{2}{2}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{2}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+%annotations
+\annotationsfirstrow {} {} {} {} {} {} {} {}
+\annotationssecondrow {} {} {9} {} {} {} {} {}
+\annotationsthirdrow {} {8} {5} {4} {11} {} {} {}
+\annotationsfourthrow {} {10} {3} {} {} {6} {} {}
+\annotationsfifthrow {} {} {7} {} {} {1} {} {}
+\annotationssixthrow {} {} {13} {2} {12} {14} {} {}
+\annotationsseventhrow {} {} {} {} {15} {} {} {}
+\annotationseighthrow {} {} {} {} {} {} {} {}
+\end{othelloboard}
+\end{minipage}
+\begin{minipage}[t]{248pt}
+\vspace{8pt}
+\begin{footnotesize}
+\begin{verbatimtab}
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{2}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{2}{2}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{2}{0}{0}{0}
+%annotations
+\annotationssecondrow {} {} {9}{} {} {} {} {}
+\annotationsthirdrow {}{8}{5}{4}{11}{} {} {}
+\annotationsfourthrow {}{10}{3}{} {} {6}{} {}
+\annotationsfifthrow {} {} {7}{} {} {1}{} {}
+\annotationssixthrow {}{}{13}{2}{12}{14}{}{}
+\annotationsseventhrow {} {} {} {}{15}{} {} {}
+\end{othelloboard}
+\end{verbatimtab}
+\end{footnotesize}
+\end{minipage}
+\ \\
+\noindent \begin{minipage}[t]{212pt}
+\vspace{0pt}
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarrayfirstrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{1}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{1}{1}{1}{0}{0}
+\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
+\othelloarrayeighthrow {0}{0}{0}{0}{0}{0}{0}{0}
+%annotations
+\annotationssecondrow {} {} {} {} {} {} {} {}
+\annotationsthirdrow {} {} {} {} {} {} {} {}
+\annotationsfourthrow {} {} {} {} {} {} {} {}
+\annotationsfifthrow {c} {} {} {} {} {} {} {}
+\annotationssixthrow {} {} {} {} {} {} {} {}
+\annotationsseventhrow {} {} {} {b} {a?} {} {} {}
+\end{othelloboard}
+\end{minipage}
+\begin{minipage}[t]{248pt}
+\vspace{8pt}
+\begin{footnotesize}
+\begin{verbatimtab}
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarraysecondrow {0}{0}{2}{0}{0}{0}{0}{0}
+\othelloarraythirdrow {0}{1}{2}{2}{2}{0}{0}{0}
+\othelloarrayfourthrow {0}{1}{2}{1}{2}{1}{0}{0}
+\othelloarrayfifthrow {0}{0}{2}{2}{1}{1}{0}{0}
+\othelloarraysixthrow {0}{0}{2}{1}{1}{1}{0}{0}
+%annotations
+\annotationssecondrow {} {} {} {} {} {} {} {}
+\annotationsthirdrow {} {} {} {} {} {} {} {}
+\annotationsfourthrow {} {} {} {} {} {} {} {}
+\annotationsfifthrow {c}{} {} {} {} {} {} {}
+\annotationssixthrow {} {} {} {} {} {} {} {}
+\annotationsseventhrow {} {} {}{b}{a?}{} {} {}
+\end{othelloboard}
+\end{verbatimtab}
+\end{footnotesize}
+\end{minipage}
+\ \\
+
+A row of annotations is added with an \verb=\annotations=\ldots\ command. Again, there is one for each row, each taking eight arguments. Here is a possible instance of the command for adding annotations to the fifth row:
+
+\begin{description}
+\item{\verb=\annotationsfifthrow{}{43}{17}{}{}{a}{b?}{??}=} The command has an argument place for each of the squares a5--h5. The command simply prints the value of each argument, centred at the corresponding square. Any string is possible as an argument (including use of symbols in \verb=mathmode=), though you will probably only want to use one- or two-digit numerals or single letters (as in both of the diagrams just given). To leave a square unannotated, put nothing -- \verb={}= -- between the braces; putting zero -- \verb={0}= -- prints a \verb=0=.
+\end{description}
+
+To annotate a diagram just add the corresponding annotation command for each row you want to annotate. Make sure that the \verb=\annotations=\ldots\ commands appear \emph{below} the \verb=\othelloarray=\ldots\ commands.
+
+\paragraph{Text colour}
+You do not have to specify the colour of annotation text, since the \textsf{othelloboard} package is smart enough to work out the colour of the disc (or diamond) underneath the text on the same square. Annotations on a black shape are automatically set in white; other annotations are set in the default text colour (black), including those on empty squares.
+
+\subsection{Placing an individual annotation at a specified square}
+
+It is also possible to place an individual annotation at a specific square by giving the square name. The command for this is:
+
+\verb=\posannotation{<=\emph{squarename}\verb=>}{<=\emph{annotationstring}\verb=>}=
+
+So \verb=\posannotation{F2}{47}= puts the numeral `47' at square f2.
+
+
+\subsection{Transcripts}
+Using \verb=\annotations=\ldots\ together with \verb=\othelloarray=\ldots\ commands, it is thus possible to set any transcript in the two standard styles: \\
+
+\noindent \begin{picture}(216,220)(12,-16)
+\begin{othelloboard}{1}
+\othelloarrayfirstrow {1}{2}{1}{1}{2}{1}{2}{1}
+\othelloarraysecondrow {2}{1}{2}{2}{2}{1}{2}{2}
+\othelloarraythirdrow {2}{2}{2}{1}{2}{1}{1}{1}
+\othelloarrayfourthrow {1}{1}{2}{1}{2}{1}{2}{2}
+\othelloarrayfifthrow {2}{1}{1}{2}{1}{2}{2}{1}
+\othelloarraysixthrow {1}{2}{2}{1}{2}{2}{1}{1}
+\othelloarrayseventhrow {2}{1}{1}{2}{1}{1}{2}{2}
+\othelloarrayeighthrow {2}{1}{2}{2}{1}{1}{2}{1}
+\annotationsfirstrow {54} {51} {34} {30} {31} {32} {41} {42}
+\annotationssecondrow {55} {50} {43} {33} {29} {28} {39} {58}
+\annotationsthirdrow {23} {27} {3} {4} {25} {8} {40} {59}
+\annotationsfourthrow {24} {22} {5} {} {} {6} {37} {60}
+\annotationsfifthrow {47} {20} {14} {} {} {1} {35} {38}
+\annotationssixthrow {26} {21} {15} {2} {9} {7} {12} {36}
+\annotationsseventhrow {49} {56} {16} {11} {10} {18} {45} {53}
+\annotationseighthrow {57} {46} {17} {13} {44} {52} {19} {48}
+%\put(12,-14){Figure 3.2}
+\end{othelloboard}
+\end{picture}
+\begin{minipage}[b]{320pt}
+\begin{footnotesize}
+\begin{verbatimtab}
+\begin{othelloboard}{1}
+\othelloarrayfirstrow {1}{2}{1}{1}{2}{1}{2}{1}
+\othelloarraysecondrow {2}{1}{2}{2}{2}{1}{2}{2}
+\othelloarraythirdrow {2}{2}{2}{1}{2}{1}{1}{1}
+\othelloarrayfourthrow {1}{1}{2}{1}{2}{1}{2}{2}
+\othelloarrayfifthrow {2}{1}{1}{2}{1}{2}{2}{1}
+\othelloarraysixthrow {1}{2}{2}{1}{2}{2}{1}{1}
+\othelloarrayseventhrow {2}{1}{1}{2}{1}{1}{2}{2}
+\othelloarrayeighthrow {2}{1}{2}{2}{1}{1}{2}{1}
+%annotations
+\annotationsfirstrow {54}{51}{34}{30}{31}{32}{41}{42}
+\annotationssecondrow {55}{50}{43}{33}{29}{28}{39}{58}
+\annotationsthirdrow {23}{27}{3} {4} {25} {8}{40}{59}
+\annotationsfourthrow {24}{22}{5} {} {} {6}{37}{60}
+\annotationsfifthrow {47}{20}{14} {} {} {1}{35}{38}
+\annotationssixthrow {26}{21}{15} {2} {9} {7}{12}{36}
+\annotationsseventhrow {49}{56}{16}{11}{10}{18}{45}{53}
+\annotationseighthrow {57}{46}{17}{13}{44}{52}{19}{48}
+\end{othelloboard}
+\end{verbatimtab}
+\end{footnotesize}
+\end{minipage}
+
+\noindent \begin{picture}(216,220)(12,-16)
+\begin{othelloboard}{1}
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\annotationsfirstrow {54} {51} {34} {30} {31} {32} {41} {42}
+\annotationssecondrow {55} {50} {43} {33} {29} {28} {39} {58}
+\annotationsthirdrow {23} {27} {3} {4} {25} {8} {40} {59}
+\annotationsfourthrow {24} {22} {5} {} {} {6} {37} {60}
+\annotationsfifthrow {47} {20} {14} {} {} {1} {35} {38}
+\annotationssixthrow {26} {21} {15} {2} {9} {7} {12} {36}
+\annotationsseventhrow {49} {56} {16} {11} {10} {18} {45} {53}
+\annotationseighthrow {57} {46} {17} {13} {44} {52} {19} {48}
+%\put(12,-14){Figure 3.3 \label{Figure 3.3}}
+\end{othelloboard}
+\end{picture}
+\begin{minipage}[b]{248pt}
+\begin{footnotesize}
+\begin{verbatimtab}
+\begin{othelloboard}{1}
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+%annotations
+\annotationsfirstrow {54}{51}{34}{30}{31}{32}{41}{42}
+\annotationssecondrow {55}{50}{43}{33}{29}{28}{39}{58}
+\annotationsthirdrow {23}{27}{3} {4} {25} {8}{40}{59}
+\annotationsfourthrow {24}{22}{5} {} {} {6}{37}{60}
+\annotationsfifthrow {47}{20}{14} {} {} {1}{35}{38}
+\annotationssixthrow {26}{21}{15} {2} {9} {7}{12}{36}
+\annotationsseventhrow {49}{56}{16}{11}{10}{18}{45}{53}
+\annotationseighthrow {57}{46}{17}{13}{44}{52}{19}{48}
+\end{othelloboard}
+\end{verbatimtab}
+\end{footnotesize}
+\ \\
+\ \\
+\end{minipage}
+
+\section{Automated methods for board creation}
+
+In addition to the manual row-by-row methods described in previous sections for creating board diagrams, \textsf{othelloboard} also supports the automated creation of board diagrams and transcripts from long strings of text in a standard format used by Othello software such as WZebra and Cassio.
+
+\subsection{Drawing a transcript from a list of moves}
+
+It is common practice to give a game transcript as a single long alphanumeric string. Here's an example exported from Cassio:
+
+C4C3D3C5B4D2D6C6E6F4B3B5F3F5G3G4A5A6C2A4A3B6E1C1A7F2C7C8D7F6G6F7
+E2D1E8F8D8E7G5H3F1H6E3G1B2B1H4A1A2A8H5B7B8G2H7H8G8G7H2H1
+
+To draw the board for this transcript you can use \verb=\drawtranscript{<=\emph{longstring}\verb=>}=.
+
+\begin{center}%
+\begin{minipage}[c]{160pt}%
+\vspace{0pt}
+\begin{othelloboard}{.8}
+\othelloarrayfourthrow{0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow{0}{0}{0}{2}{1}{0}{0}{0}
+\drawtranscript{C4C3D3C5B4D2D6C6E6F4B3B5F3F5G3G4A5A6C2A4A3B6E1C1A7F2C7C8D7F6G6F7E2D1E8F8D8E7G5H3F1H6E3G1B2B1H4A1A2A8H5B7B8G2H7H8G8G7H2H1}
+\end{othelloboard}
+\end{minipage}
+\hfill
+\begin{minipage}[c]{264pt}
+\begin{footnotesize}
+\begin{verbatimtab}
+\begin{othelloboard}{.8}
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\drawtranscript{C4C3D3C5B4D2D6C6E6...B8G2H7H8G8G7H2H1}
+\end{othelloboard}
+\end{verbatimtab}
+\end{footnotesize}
+\end{minipage}
+\end{center}
+
+\subsection{Drawing a board diagram from a single long string}
+Several programs use a standard long string of dashes, Xs and Os to import and export board diagrams. \textsf{othelloboard} also supports such strings. Here is a typical string taken from Cassio:
+
+\begin{small}
+\verb=XO---XXX-OOO-OOO-OOOOOO---OOXO---OOXOOO-OOXOOOOOXXXXX---XXXXXX--=
+\end{small}
+
+An `X' represents a black disc, an `O' a white disc, and a dash (`-') an empty square. The string gives the state of every square reading from the top row down, left to right.
+
+To create a board diagram from this string, we simply feed it as an argument into the \verb=\drawboardfromstring{<=\emph{longstring}\verb=>}= command:
+\begin{center}
+\begin{minipage}[c]{144pt}
+\vspace{0pt}
+\begin{othelloboard}{.8}
+\drawboardfromstring{XO---XXX-OOO-OOO-OOOOOO---OOXO---OOXOOO-OOXOOOOOXXXXX---XXXXXX--}
+\end{othelloboard}
+\end{minipage}
+\hfill
+\begin{minipage}[c]{272pt}
+\begin{footnotesize}
+\begin{verbatim}
+\begin{othelloboard}{.8}
+\drawboardfromstring{XO---XXX-OOO-OOO-...--XXXXXX--}
+\end{othelloboard}
+\end{verbatim}
+\end{footnotesize}
+\end{minipage}
+\end{center}
+
+The characters \verb=3= and \verb=4= can also be included in the string for white and black diamonds (respectively).
+
+\section{Tweaks}
+Feel free to tweak the code in the \verb=othelloboard.sty= file if the diagrams aren't exactly how you like them. I've commented on it quite thoroughly so that it should be easy to see which bit to tweak in order, e.g., to change the font size of the grid references, or the size of the discs relative to the grid.\\
+
+If you know that you will want marker dots on every diagram you make, you can simply add the following to your preamble (though after you call for the package):\\
+
+\noindent \verb=let\Oldothellogrid\othellogrid= \\
+\verb=\renewcommand{\othellogrid}{\dotmarkings\Oldothellogrid}= \\
+
+\noindent Now the \verb=\dotmarkings= command will be automatically executed each time you enter into an \verb=othelloboard= (or \verb=othelloboardnorefs=) environment.\\
+\ \\
+
+\noindent If you have any suggestions for improving or adding to this package, I'd be very keen to hear them. Or if you need some help tweaking the package for a particular application I'd be happy to hear from you about that too. Email me on \verb=stevenhall.uk@gmail.com=.
+
+
+\clearpage
+\appendix
+\appendixpage
+\section{Layout of diagrams}
+\label{appendix:layout}
+\noindent The board diagrams drawn with the \textsf{othelloboard} package are contained inside a \verb=picture= environment box. They behave like any diagrams drawn inside of the \verb=picture= environment and can be embedded within further boxes for accurate positioning around the page. They can also be enclosed within a \verb=figure= environment or any other float and treated like any diagram you might insert into a document, e.g.\ with labels and captions. The function of this package is just to provide diagrams neatly embedded in a box; the positioning and use of this box is up to you. However, here is some more detailed information about how the box is created and a few tips you may find useful.\\
+
+\noindent The grid of a standard-sized diagram is contained in a 192pt$\times$192pt box that itself is positioned in the bottom right corner of a slightly larger 208pt$\times$208pt box (see dotted line), creating 16pt margins on the left and at the top to allow for alphanumeric labels with a little room spare for padding (with scaled diagrams the proportions are all kept the same, including the margins). It is the larger containing box that you control when you create a standard Othello diagram. The diagram immediately below is set with no vertical space separating it from the text above and below. \\
+\noindent\begin{picture}(240,208)
+\vspace{0pt}
+\dashbox{2}(208,208)[br]{\begin{othelloboard}{1}
+\gridrefs
+\dotmarkings
+\end{othelloboard}}
+\put(24,200){\vector(-1,0){24} \scriptsize{16pt margin}}
+\put(8,110){\vector(0,1){98}}
+\put(4,102){\scriptsize{208pt}}
+\put(8,98){\vector(0,-1){98}}
+\put(28,102){\vector(0,1){90}}
+\put(24,94){\scriptsize{192pt}}
+\put(28,90){\vector(0,-1){90}}
+\end{picture}
+
+\noindent It is conceivable that you might want to create an Othello board diagram with no labels and no margins at the top and left side. In this case, you can use the \verb=othelloboardnorefs= environment (see \ref{norefs}), which works just like the \verb=othelloboard= environment except that it produces board diagrams without labels. This environment leaves out the 208pt$\times$208pt containing box that allows margins for the labels, and just draws the 192pt$\times$192pt grid inside of a 192pt$\times$192pt box. Here is an example, again with the diagram placed on the very next line of text with no vertical space, showing the absence of padding around the board.\\
+\clearpage
+\noindent (Paragraph of text immediately above the diagram code.)\\
+\noindent
+\begin{othelloboardnorefs}{1}
+\dotmarkings
+\end{othelloboardnorefs}
+
+\noindent The last two diagrams are the result of putting an \verb=othelloboard= or \verb=othelloboardnorefs= environment between two paragraphs with no extra thought about spacing and layout. It may be sufficient for your needs simply to add line breaks or vertical space before and after a diagram. Alternatively, here are a couple of examples using other methods with nicer results.\\
+
+\noindent Here's a captioned diagram enclosed and centred within a \verb=figure= environment. The code used for this and the following numbered figures is given at the end of this section.
+
+\begin{figure}[h]
+\begin{center}
+\begin{othelloboard}{.8}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{The opening position}
+\end{center}
+\end{figure}
+
+\noindent Here's an example of a diagram set in a block of text using the \verb=wrapfig= package. \\
+
+\noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+\begin{wrapfigure}{r}{152pt}
+\begin{othelloboard}{0.75}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{An example using the \texttt{wrapfig} package}
+\end{wrapfigure}
+blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah Blah blah blah blah blah blah blah\\
+
+\noindent Here are a couple of diagrams side-by-side in a \verb=figure= environment.\\
+
+\begin{figure}[ht]
+\begin{minipage}[b]{0.5\linewidth}
+\centering
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{left diagram}
+\end{minipage}
+\hspace{0.5cm}
+\begin{minipage}[b]{0.5\linewidth}
+\centering
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{right diagram}
+\end{minipage}
+\end{figure}
+
+\noindent You might also consider using \verb=minipage=s to align diagrams, or text and diagrams, horizontally:
+
+\begin{center}
+\begin{minipage}[c]{192pt}
+\textsf{
+\begin{othelloboardnorefs}{1}
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\annotationseighthrow{}{C}{A}{B}{B}{A}{C}{}
+\end{othelloboardnorefs}}
+\end{minipage}
+\hfill
+\begin{minipage}[c]{192pt}
+Figure 5\\
+
+The text over here is in the \verb=minipage= on the right. Both \verb=minipage=s are contained within a \verb=center= environment in this example.\\
+
+The annotations are in a san-serif font this time.
+\end{minipage}
+\end{center}
+\bigskip
+
+For more examples of layouts using diagrams of different sizes, see the file: \texttt{example\--rose\--chps1\--2.pdf}.
+
+\subsection{Code for the examples in this section}
+
+\begin{scriptsize}
+\begin{multicols}{2}
+\noindent Figure 1:
+\begin{verbatim}
+\begin{figure}[h]
+\begin{center}
+\begin{othelloboard}{.8}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{The opening position}
+\end{center}
+\end{figure}
+\end{verbatim}
+
+\noindent Figure 2:
+\begin{verbatim}
+id est laborum ...
+\begin{wrapfigure}{r}{152pt}
+\begin{othelloboard}{0.75}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{An example using the \texttt{wrapfig}
+package}
+\end{wrapfigure}
+blah blah blah blah ...
+\end{verbatim}
+
+\noindent Figures 3 \& 4:
+\begin{verbatim}
+begin{figure}[ht]
+\begin{minipage}[b]{0.5\linewidth}
+\centering
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{left diagram}
+\end{minipage}
+\hspace{0.5cm}
+\begin{minipage}[b]{0.5\linewidth}
+\centering
+\begin{othelloboard}{1}
+\dotmarkings
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\end{othelloboard}
+\caption{right diagram}
+\end{minipage}
+\end{figure}
+\end{verbatim}
+
+\noindent Figure 5:
+\begin{verbatim}
+\begin{center}
+\begin{minipage}[c]{192pt}
+\textsf{
+\begin{othelloboardnorefs}{1}
+\othelloarrayfourthrow {0}{0}{0}{1}{2}{0}{0}{0}
+\othelloarrayfifthrow {0}{0}{0}{2}{1}{0}{0}{0}
+\annotationseighthrow{}{C}{A}{B}{B}{A}{C}{}
+\end{othelloboardnorefs}}
+\end{minipage}
+\hfill
+\begin{minipage}[c]{192pt}
+Figure 5\\
+
+The text over here is in the \verb=minipage= on the
+right. Both \verb=minipage=s are contained within
+a \verb=center= environment in this example.\\
+
+The annotations are in a san-serif font this time.
+\end{minipage}
+\end{center}
+\end{verbatim}
+
+\end{multicols}
+\end{scriptsize}
+
+\section{Other commands}
+
+\noindent You may want to exploit some of the lower-level commands that were defined as part of main commands for this package. Suppose you want to draw just a couple of discs and diamonds, but without putting them in a board diagram. You might want to make sure that these are the same size and style as those used in actual board diagrams (perhaps you're writing a key like the one on page \pageref{disckey}). In that case, you can use these commands:\\
+
+\begin{tabular}{lclc}
+\verb=\whitedisc= \hspace{8pt}& \begin{picture}(20,20)\put(10,5){\whitedisc} \end{picture}& \verb=\whitediamond= \hspace{8pt} &\begin{picture}(20,20)\put(10,5){\whitediamond} \end{picture}\\
+\verb=\blackdisc= \hspace{8pt}& \begin{picture}(20,20)\put(10,5){\blackdisc} \end{picture} & \verb=\blackdiamond= \hspace{8pt} &\begin{picture}(20,20)\put(10,5){\blackdiamond} \end{picture} \\
+\end{tabular}\\
+\ \\
+
+They work best within a \verb=picture= environment using the \verb=\put= command for accurate placing. Note that the shapes are positioned from their centre-points. These are the same sub-commands that the \verb=\othelloarray=\ldots\verb=row= commands call upon when they execute, so using these ensures the size and style of shapes will be the same as those appearing within board diagrams within the same document.
+
+\subsection{Counters}
+The \textsf{othelloboard} package uses counters to store the value of discs/diamonds placed on each square (this is the same value you input in order to draw the discs/diamonds). The package currently only uses these counters to determine the text colour of annotations, but these values are available for the current board diagram until another is drawn (the counters are all reset initially as part of the code for a new diagram).
+
+The counter names follow this format:\\
+
+\verb=disccolourxy=\\
+
+where \verb=xy= is the name for a square. Since \LaTeX\ doesn't allow numbers in counter names, the \verb=x= and the \verb=y= are both letters a--h. This needn't be confusing however. The convention is still standard: column name first, row name second. Thus the square g2 is called \verb=gb= for the purpose of counters.
+
+\noindent To write the value (0--4) of the disc at g2, simply use the code: \verb=\arabic{disccolourgb}=. To use the value of the disc at g2 as part of another command, simply use \verb=\value{disccolourgb}=.
+
+\noindent To illustrate the availability of these counters, here is a lazy way of counting discs that you might use. First, define a couple of further counters to store the number of white and black discs:\\
+
+\verb=\newcounter{numberwdiscs}=
+
+\verb=\newcounter{numberbdiscs}=\\
+
+Next, define a couple of commands for counting up white (black) discs and storing the result in the counters just defined:\footnote{I've now included the full code for the example at the end of the package file in case you'd like to play with it (so you needn't define these commands yourself, they'll just work). The counting commands don't run automatically however with each diagram, to save unnecessary processing. So if you want to use the value of one of the counters, you have to run the count command first.}
+
+\begin{verbatimtab}
+\newcommand{\countwhitediscs}{% increments the counter for every white disc found.
+\ifthenelse{\equal{\value{disccolouraa}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+\ifthenelse{\equal{\value{disccolourba}}{1}}{\addtocounter{numberwdiscs}{1}}{}
+... }
+\end{verbatimtab}
+
+\noindent Now you can just run the count commands and write \verb=\arabic{numberwdiscs}= or \\
+\verb=\arabic{numberbdiscs}= to print the number of white (black) discs.
+\begin{center}
+\begin{minipage}[c]{192pt}
+\textsf{
+\begin{othelloboard}{.6}
+\dotmarkings
+\othelloarrayfirstrow{2}{2}{2}{2}{2}{2}{2}{2}
+\othelloarraysecondrow{2}{2}{2}{2}{2}{1}{1}{2}
+\othelloarraythirdrow{2}{1}{1}{2}{1}{1}{1}{2}
+\othelloarrayfourthrow {2}{1}{2}{1}{1}{1}{1}{2}
+\othelloarrayfifthrow {2}{2}{2}{1}{1}{1}{1}{2}
+\othelloarraysixthrow {2}{2}{1}{1}{1}{1}{1}{2}
+\othelloarrayseventhrow {0}{1}{2}{1}{2}{2}{2}{2}
+\othelloarrayeighthrow {1}{0}{2}{1}{1}{1}{1}{1}
+\end{othelloboard}}
+\end{minipage}
+%\hfill
+\begin{minipage}[c]{192pt}
+\countwhitediscs
+\countblackdiscs
+Number of white discs: \arabic{numberwdiscs} \\
+Number of black discs: \arabic{numberbdiscs} \\
+\end{minipage}
+\end{center}
+\ \\
+
+Admittedly this doesn't seem like a very useful feature, but if you like playing with this sort of thing you might find it useful to know that the \verb=disccolourxy= counters are available for use after each diagram is drawn.
+
+\section{Most likely errors}
+
+\begin{itemize}
+\item Forgetting to specify a size argument along with the \verb=\begin{othelloboard}= declaration.
+\item Putting spaces between the `\verb=w=' in a command name and the `\verb={=' of the first argument. Use tabs if you want to align the arguments for an array (see section \ref{tabtips} above). Also make sure there are no spaces between arguments.
+\item Forgetting to include an \verb=\end{othelloboard}= declaration at the end of each diagram.
+\end{itemize}
+
+\section{Changes}
+\subsubsection*{18 August 2011}
+\begin{itemize}
+\item Extended the \verb=\drawboardfromstring= command to recognize the characters \verb=3= and \verb=4= (for diamonds) in a string.
+\item Included example material typeset using this package -- two chapters from Brian Rose's book.
+\end{itemize}
+
+\bibliographystyle{phil_review}
+\begin{thebibliography}{1}
+\bibitem{Rose2005} Brian Rose (2005). \emph{Othello: A Minute to Learn \ldots\ A Lifetime to Master}.\\[6pt]
+The official version can be downloaded from http://othellogateway.com/rose/book.pdf.
+\end{thebibliography}
+
+\clearpage
+
+\makebox[0pt][l]{\hspace{-64pt}
+\begin{othelloboard}{2.6}
+\dotmarkings
+\othelloarrayfirstrow {1}{2}{1}{1}{2}{1}{2}{1}
+\othelloarraysecondrow {2}{1}{2}{2}{2}{1}{2}{2}
+\othelloarraythirdrow {2}{2}{2}{1}{2}{1}{1}{1}
+\othelloarrayfourthrow {1}{1}{2}{1}{2}{1}{2}{2}
+\othelloarrayfifthrow {2}{1}{1}{2}{1}{2}{2}{1}
+\othelloarraysixthrow {1}{2}{2}{1}{2}{2}{1}{1}
+\othelloarrayseventhrow {2}{1}{1}{2}{1}{1}{2}{2}
+\othelloarrayeighthrow {2}{1}{2}{2}{1}{1}{2}{1}
+\annotationsfirstrow {54} {51} {34} {30} {31} {32} {41} {42}
+\annotationssecondrow {55} {50} {43} {33} {29} {28} {39} {58}
+\annotationsthirdrow {23} {27} {3} {4} {25} {8} {40} {59}
+\annotationsfourthrow {24} {22} {5} {} {} {6} {37} {60}
+\annotationsfifthrow {47} {20} {14} {} {} {1} {35} {38}
+\annotationssixthrow {26} {21} {15} {2} {9} {7} {12} {36}
+\annotationsseventhrow {49} {56} {16} {11} {10} {18} {45} {53}
+\annotationseighthrow {57} {46} {17} {13} {44} {52} {19} {48}
+\end{othelloboard}
+}
+
+
+%------
+\end{document}