(***********************************************************************
Mathematica-Compatible Notebook
This notebook can be used on any computer system with Mathematica 4.0,
MathReader 4.0, or any compatible application. The data for the notebook
starts with the line containing stars above.
To get the notebook into a Mathematica-compatible application, do one of
the following:
* Save the data starting with the line of stars above into a file
with a name ending in .nb, then open the file inside the application;
* Copy the data starting with the line of stars above to the
clipboard, then use the Paste menu command inside the application.
Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode. Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).
NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing the
word CacheID, otherwise Mathematica-compatible applications may try to
use invalid cache data.
For more information on notebooks and Mathematica-compatible
applications, contact Wolfram Research:
web: http://www.wolfram.com
email: info@wolfram.com
phone: +1-217-398-0700 (U.S.)
Notebook reader applications are available free of charge from
Wolfram Research.
***********************************************************************)
(*CacheID: 232*)
(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[ 65447, 1670]*)
(*NotebookOutlinePosition[ 66162, 1695]*)
(* CellTagsIndexPosition[ 66118, 1691]*)
(*WindowFrame->Normal*)
Notebook[{
Cell[CellGroupData[{
Cell["\<\
MathSource Reviews
n-D Noughts and Concomitant Crosses\
\>", "Title"],
Cell["by Matthew M. Thomas", "Subtitle"],
Cell[TextData[{
"Given the lighthearted subject of this Review, it seems appropriate that \
we begin with this entry from page 406 of the 1951 ",
StyleBox["Oxford Dictionary of Mother Goose Rhymes",
FontSlant->"Italic"],
" [Gardner 1959]:"
}], "Text"],
Cell["\<\
Tit, tat, toe,
My first go,
Three jolly butcher boys all in a row.
Stick one up, stick one down,
Stick one in the old man's crown. \
\>", "Text",
TextAlignment->Center],
Cell["\<\
Your reviewer played this game as a child; so did you. On the Continent, the \
game is commonly known as noughts and crosses; in the States, tic-tac-toe (or \
ticktacktoe). In this MathSource Reviews column, let us first delve into the \
background of this ancient game. We'll then examine MathSource item \
/Applications/Other/0209-247, TicTac.nb by Jon McLoone of Wolfram Research \
Europe Ltd. Even though WRI's McLoone labels his contribution \"TicTacToe \
Game,\" we pay heed to his European station by using a play on the European \
name for this column's title; throughout the column, we shall also be using \
the \"noughts and crosses\" name. After examining TicTac.nb and running its \
code, we shall conclude with an overall assessment.\
\>", "Text"],
Cell[CellGroupData[{
Cell["BACKGROUND", "Section"],
Cell["\<\
The conventional version of the game is played on a two-dimensional, 3x3 \
square board, between player O (noughts) and player X (crosses). In keeping \
with the convention adopted by McLoone, player O always moves first. The \
object of the game is to place three of one's own marks in a horizontal, \
vertical, or diagonal row on the board. Players O and X alternate mark \
placement until either a player achieves three marks in a row, or the nine \
spaces are filled but with neither player achieving three-in-a-row. There are \
9! or 362,880 sequences for filling those nine spaces with Os and Xs. When \
board symmetry, rational play, and other factors are taken into \
consideration, the number of viable paths to completion are far fewer than 9! \
If one were to fill a noughts-and-crosses board with every possible sequence \
of five Os and four Xs, first player O would win 212,256/362,880 = .585 of \
the games, second player X would win 104,544/362,880 = .288 of them, and \
46,080/362,880 = .127 would result in stalemates. With rational play \
(striving for three marks in a row; blocking similar attempts by the \
opponent) on both sides, however, the rational game outcome is a draw -- not \
one-eighth of the time, but eight-eighths of the time.\
\>", "Text"],
Cell[TextData[{
"The conventional version of the game is finite (comes to a definite end), \
with no element of chance and with perfect information available to both \
players. Since the only rational game outcome is a draw, a win can occur only \
by one player \"trapping\" the other (",
StyleBox["i.e.",
FontSlant->"Italic"],
", positioning his marks such that he can achieve three-in-a-row along \
either of two separate paths with his next move). Of the nine board spaces, \
four are corners, four are sides, and one is a center: If first player O \
opens by taking a corner, second player X ",
StyleBox["must",
FontSlant->"Italic"],
" take center to avoid a trap; if O opens by taking a side, X ",
StyleBox["must",
FontSlant->"Italic"],
" take center, an adjoining corner, or the in-row side to avoid a trap; if \
O opens by taking center, X must take a corner to avoid a trap[Gardner 1959, \
p. 38]. Berlekamp, Conway, and Guy [Berlekamp ",
StyleBox["et al",
FontSlant->"Italic"],
" 1982, pp. 670-671] offer a complete and thorough mapping from any board \
state to each possible outcome, with a total of 104 quasi-unique outcomes in \
which first player O wins 47 times, second player X wins 16 times, and \
stalemates occur 41 times."
}], "Text"],
Cell[TextData[{
"Simple 3x3 noughts and crosses is the ",
Cell[BoxData[
\(TraditionalForm\`3\^2\)]],
" entry in a set of ",
Cell[BoxData[
\(TraditionalForm\`k\^n\)]],
"games (k = spaces along any side; n = dimensions of the hypercubic game \
board). It has been shown [Moser 1948] that for ",
Cell[BoxData[
\(TraditionalForm\`k\^n\)]],
" noughts and crosses, there are (",
Cell[BoxData[
\(TraditionalForm\`\((k + 2)\)\^n\)]],
" - ",
Cell[BoxData[
\(TraditionalForm\`k\^n\)]],
")/2 paths to k-in-a-row. So, for conventional 3x3 play, there are eight \
such paths (three horizontal, three vertical, two diagonal); for 4x4x4 (k = \
4, n = 3), there are seventy-six (48 orthogonal, 24 planar diagonal, 4 main \
cube diagonal). For both 3x3 and 4x4x4 play, draw positions exist, but for \
3x3x3 play, the first player O can always force a win (and, in fact, no draw \
sequence exists): The original theorem was that if k \[GreaterEqual] ",
Cell[BoxData[
\(TraditionalForm\`3\^n\)]],
" - 1 (odd k) or k \[GreaterEqual] ",
Cell[BoxData[
\(TraditionalForm\`2\^\(n + 1\)\)]],
"- 2 (even k), then the second player X can force a tie, but if n is \
sufficiently large compared to k, then the first player O can force a win \
[Hales and Jewett 1963]. A subsequent theorem implies that the second player \
X can force a draw if k > c n log n or ",
Cell[BoxData[
FormBox[
SuperscriptBox["2",
RowBox[{"[",
RowBox[{
RowBox[{"(", GridBox[{
{"k"},
{"2"}
}], ")"}], "-", "1"}], "]"}]], TraditionalForm]]],
" > ",
Cell[BoxData[
FormBox[
RowBox[{"(", GridBox[{
{"n"},
{"k"}
}], ")"}], TraditionalForm]]],
" [Erd\[ODoubleDot]s and Selfridge 1973]. Beck in turn theorizes that if k \
\[GreaterEqual] ",
Cell[BoxData[
\(TraditionalForm\`\(log\ 3\)\/\(log\ 2\)\)]],
" n + 4 ",
Cell[BoxData[
\(TraditionalForm\`\@\(n\ log\ n\)\)]],
" + 4 and n \[GreaterEqual] 100 (100-dimension tic-tac-toe!), then the \
second player can force a draw [Beck 1981]. Paul provides an alternate proof \
to the 1948 work by Moser ",
StyleBox["et al",
FontSlant->"Italic"],
" regarding k-in-a-row paths in ",
Cell[BoxData[
\(TraditionalForm\`k\^n\)]],
"noughts and crosses, and asserts that even when draw positions exist, \
first player O might still be able to force a win [Paul 1978]; it was later \
proved that draw positions exist whenever k \[GreaterEqual] n and n \
\[GreaterEqual] 4 . . . though the existence of such positions is no \
guarantee that second player X can force a draw [Paul 1979]."
}], "Text"],
Cell[TextData[{
"Tying together these trails of ",
Cell[BoxData[
\(TraditionalForm\`k\^n\)]],
"noughts and crosses theory is an exemplary work from Oren Patashnik of \
Bell Laboratories [Patashnik 1980]. Rather than put forward yet another \
theory relating the sizes of k and n to whether second player X can force a \
draw, Patashnik presents a 75-element grid for 1 \[LessEqual] k \[LessEqual] \
15 and 1 \[LessEqual] n \[LessEqual] 5: For each of the 75 ",
Cell[BoxData[
\(TraditionalForm\`k\^n\)]],
"noughts and crosses game arrangements, the grid lists number of spaces in \
the game board, number of paths to k-in-a-row, number of \
\"strongest-point-lines\" (a parameter corresponding to Hales and Jewett's \
work), and whether the game is class 1 (no draw position exists; first player \
O can force a win), class 3 (second player X can force a draw), or class 2 \
(draw positions exist; first player O can nevertheless force a win). \
Patashnik labels 4x4x4 noughts and crosses \"Qubic\". Using 1500 computer \
hours on a PDP10 in the Yale University computer science department (and \
despite \"wasting\" half of them on bad strategic moves), Patashnik proved \
Paul's [1978, p. 46] conjecture that ",
Cell[BoxData[
\(TraditionalForm\`4\^3\)]],
"noughts and crosses both allowed a forced win by first player O ",
StyleBox["and",
FontSlant->"Italic"],
" contained draw positions. As such, Qubic became the first known member of \
what Patashnik labeled class 2. Others initially criticized but ultimately \
accepted the findings of Patashnik's work [Berlekamp ",
StyleBox["et al",
FontSlant->"Italic"],
" 1982, p. 674]."
}], "Text"],
Cell[TextData[
"The 3x3 version of noughts and crosses is a natural test case for artificial \
intelligence programs. For example, it is used to illustrate application of \
\"minimax\" tactics [Nilsson 1980]. The first step of such application is to \
define an evaluation function e(p) of position p as +\[Infinity] (when p is \
a winning position for first player O), -\[Infinity] (when p is a winning \
position for second player X, or {number of three-in-a-row paths still \
available to O}-{number of three-in-a-row paths still available to X} (when p \
is not a winning position). As such, a first move by O to center produces \
e(first O = center) = 8 - 4 = +4; likewise, e(first O = corner) = 8 - 5 = +3 \
and e(first O = side) = 8 - 6 = +2. A minimax approach directs first player O \
to take the center first. Once second player X makes his first move, the \
strategy for O considers all possible responses by X to all possible second \
moves by O. The strategy computes e(p) for all possible X responses to each \
possible O second move, and assigns the minimum of those values to each \
possible second move; O then chooses the proposed second move with the \
maximum assigned e(p) value. The strategy is applied in this lookahead \
fashion for O after each countermove by X. In contrast to the minimax \
strategy, which directs first player O to take the center first, Gardner \
[1959, p. 38] would take a corner first, since of the eight first moves \
available to second player X, only one (center) avoids a trap; taking center \
first allows X trap avoidance via four of eight available first moves. What \
does Jon McLoone's MathSource contribution advise?"], "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell["HOW IT WORKS", "Section"],
Cell[TextData[{
"As mentioned earlier, our MathSource item for review is \
/Applications/Other/0209-247/TicTac.nb, a 62 kB Mathematica notebook labeled \
\"TicTacToe Game\" by Jon McLoone, who had been with Wolfram Research Europe \
Ltd. at least at the time of his item's submission to MathSource. This \
notebook is optimized for version 3.0 of Mathematica -- if you have any doubt \
about that, let the \"Mathematica 3.0\" banner at the top of TicTac.nb lift \
your doubt to faith. Unlike pre-3.0 notebooks, TicTac.nb offers you a control \
panel by way of a 2x2 buttons grid: These four buttons are labeled (clockwise \
from upper left) Human-Human, Computer-Human, Computer-Computer, and \
Human-Computer. Two such panels appear: One under \"Start 2D Game\"; the \
second under \"Start 3D Game\". As such, you the TicTac.nb user have eight \
options for noughts-and-crosses play. The labels on the buttons explain those \
options for the most part. The \"A-B\" format for each label means that A \
becomes first player O, while B is second player X. Extensive use is made of \
",
StyleBox["StyleBox[]", "Input"],
", ",
StyleBox["ButtonBox[]", "Input"],
", ",
StyleBox["RowBox[]", "Input"],
", ",
StyleBox["GridBox[]", "Input"],
", and related functions and their options . . . functions and options \
which debuted with Mathematica 3.0. Here is the aforementioned 2x2 buttons \
grid as it actually appears in TicTac.nb:"
}], "Text"],
Cell[BoxData[
StyleBox[GridBox[{
{
StyleBox[
ButtonBox[
RowBox[{
RowBox[{"Human",
StyleBox["-",
FontWeight->"Bold"],
StyleBox["Human",
FontWeight->"Plain"]}],
StyleBox[" ",
FontWeight->"Bold"]}],
ButtonFunction:>If[
SameQ[ $StartedTTT, True],
CompoundExpression[
Set[
HumanQ[ "\[EmptyCircle]"], True],
Set[
HumanQ[ "\[Times]"], True],
NewGame[ 3, 2]],
CompoundExpression[
SetDelayed[ FirstAction,
InitGame[ 3, 2, True, True]],
FrontEndTokenExecute[ "EvaluateNotebook"]]],
ButtonEvaluator->Automatic,
ButtonStyle->None,
ButtonFrame->"Palette"],
FontWeight->"Plain"],
StyleBox[
ButtonBox[
RowBox[{
RowBox[{
StyleBox["Computer",
FontWeight->"Plain"], "-", "Human"}],
StyleBox[" ",
FontWeight->"Plain"]}],
ButtonFunction:>If[
SameQ[ $StartedTTT, True],
CompoundExpression[
Set[
HumanQ[ "\[EmptyCircle]"], False],
Set[
HumanQ[ "\[Times]"], True],
NewGame[ 3, 2]],
CompoundExpression[
SetDelayed[ FirstAction,
InitGame[ 3, 2, False, True]],
FrontEndTokenExecute[ "EvaluateNotebook"]]],
ButtonEvaluator->Automatic,
ButtonStyle->None,
ButtonFrame->"Palette"],
FontWeight->"Plain"]},
{
StyleBox[
ButtonBox[
RowBox[{
RowBox[{
StyleBox["Human",
FontWeight->"Plain"], "-", "Computer"}],
StyleBox[
RowBox[{
StyleBox[" ",
FontWeight->"Plain"], " "}]]}],
ButtonFunction:>If[
SameQ[ $StartedTTT, True],
CompoundExpression[
Set[
HumanQ[ "\[EmptyCircle]"], True],
Set[
HumanQ[ "\[Times]"], False],
NewGame[ 3, 2]],
CompoundExpression[
SetDelayed[ FirstAction,
InitGame[ 3, 2, True, False]],
FrontEndTokenExecute[ "EvaluateNotebook"]]],
ButtonEvaluator->Automatic,
ButtonStyle->None],
FontWeight->"Plain"],
StyleBox[
ButtonBox[
RowBox[{
RowBox[{
StyleBox["Computer",
FontWeight->"Plain"], "-",
StyleBox[
RowBox[{"Compute",
StyleBox["r",
FontWeight->"Plain"]}]]}], " "}],
ButtonFunction:>If[
SameQ[ $StartedTTT, True],
CompoundExpression[
Set[
HumanQ[ "\[EmptyCircle]"], False],
Set[
HumanQ[ "\[Times]"], False],
NewGame[ 3, 2]],
CompoundExpression[
SetDelayed[ FirstAction,
InitGame[ 3, 2, False, False]],
FrontEndTokenExecute[ "EvaluateNotebook"]]],
ButtonEvaluator->Automatic,
ButtonStyle->None],
FontWeight->"Plain"]}
},
RowSpacings->0,
ColumnSpacings->0],
ButtonBoxOptions->{Active->True,
ButtonFrame->"Palette"}]], NotebookDefault,
Editable->False,
CellMargins->{{Inherited, Inherited}, {0, Inherited}},
Evaluatable->False,
CellGroupingRules->"NormalGrouping",
CellHorizontalScrolling->True,
PageBreakAbove->True,
PageBreakWithin->False,
GroupPageBreakWithin->False,
CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}},
DefaultFormatType->DefaultInputFormatType,
LineSpacing->{1.25, 0},
FormatType->InputForm,
ScriptMinSize->9,
ShowStringCharacters->True,
NumberMarks->True,
StyleMenuListing->None,
FontFamily->"Courier",
FontSize->14,
FontWeight->"Bold",
FontColor->GrayLevel[0],
Background->RGBColor[0.95021, 0.934356, 0.499062]],
Cell[TextData[{
"Beneath the 2-D and 3-D control panels is a section labeled \"Modification \
notes\". Within the section is an explanatory paragraph: Read it and learn \
that ",
StyleBox["$InitialRunningOrder = {\"O\", \"X\"}", "Input"],
" assigns noughts to the first player and crosses to the second, that \
default values are k = 4 for n = 3 and k = 3 for n = 2 (",
StyleBox["i.e.",
FontSlant->"Italic"],
", 4x4x4 and 3x3 game boards), that varying k produces forced win game \
boards (generally the case only upon ",
StyleBox["shrinking",
FontSlant->"Italic"],
" k for a given n), that computer-controlled tactics are based on \
maximizing ",
StyleBox["TotalScore[]", "Input"],
", which in turn is based on ",
StyleBox["ScoreOnDimension[]", "Input"],
", and that the algorithms behind these tactics are \"ex[t]remely simple\" \
and have a one-move lookahead constraint. A request for better tactical \
algorithms is also made in this section. Note: If it drives you crazy to \
follow the convention of noughts playing first, you need only set ",
StyleBox["$InitialRunningOrder", "Input"],
" to ",
StyleBox["{\"X\", \"O\"}", "Input"],
"; doing so, however, causes a computer-first move upon clicking \
\"Human-Computer\", and likewise a human-first move when \"Computer-Human\" \
is chosen."
}], "Text"],
Cell[TextData[{
"The Mathematica code itself in TicTac.nb comprises four sections (all of \
which could have benefited from more (* in-line comments *) to explain the \
code). \"Set Up\" sets ",
StyleBox["$InitialRunningOrder", "Input"],
", and creates ",
StyleBox["$RunningOrder", "Input"],
" to keep track of whose turn it is to mark the game board throughout the \
contest. \"Playing & displaying\" uses ",
StyleBox["PlaceAt[]", "Input"],
", ",
StyleBox["MakeDisplayCall[]", "Input"],
", and new (to version 3.0) built-in functions such as ",
StyleBox["Notebook[]", "Input"],
" and ",
StyleBox["Cell[]", "Input"],
" and variants thereof to create, update, and maintain the active game \
board. This board is shown in a separate Window, as a grid in the n = 2 case \
and as a row of k grids (each k x k) in the n = 3 case. These TicTac.nb \
functions do not implement tactics, but do show the results of both such \
tactics and human responses. \"Scoring & choosing moves\" is where tactical \
decisions are made, through functions such as ",
StyleBox["OneInGameGridQ[]", "Input"],
", ",
StyleBox["InGameGrid[]", "Input"],
", ",
StyleBox["SameDimension[]", "Input"],
", ",
StyleBox["WhatsOnDimension[]", "Input"],
", ",
StyleBox["CountOnDimensionRule[]", "Input"],
", ",
StyleBox["ScoreOnDimension[]", "Input"],
", ",
StyleBox["TotalScore[]", "Input"],
", and ",
StyleBox["FindBestScore[]", "Input"],
". ",
StyleBox["FindBestScore[]", "Input"],
" returns the best next move, based on the highest ",
StyleBox["TotalScore[]", "Input"],
" value for all available positions. ",
StyleBox["TotalScore[]", "Input"],
" in turn relies upon ",
StyleBox["ScoreOnDimension[]", "Input"],
", which for an available game board position and vector (four vectors for \
n = 2; thirteen for n = 3) assigns a position value based on the six tests \
(below). ",
StyleBox["ScoreOnDimension[]", "Input"],
" uses the other aforementioned functions in \"Scoring & choosing moves\" \
to handle various and sundry bookkeeping chores. Finally, the \"End\" section \
(somewhat paradoxically) carries out instructions that begin a new game."
}], "Text"],
Cell[TextData[{
"The critical ",
StyleBox["ScoreOnDimension[]", "Input"],
" function in TicTac.nb is written around a ",
StyleBox["Which[]", "Input"],
" conditional function. Six tests/values (and a default value of zero) are \
built into this use of ",
StyleBox["Which[]", "Input"],
". For a given game board space and vector, here are those six tests and \
corresponding values:\n1) if a player has k marks in a row, value = \
\[Infinity] (player has won)\n2) if the opponent has k marks in a row, value \
= \[Infinity] (opponent has won)\n3) if a game board space is free, and \
filling it would make k-in-a-row for the player, value = 20,000 k\n4) if a \
game board space is free, and filling it would ",
StyleBox["block",
FontSlant->"Italic"],
" k-in-a-row for the opponent, value = 10,000 k\n5) if, along a vector, the \
sum of spaces filled by a player's marks plus free spaces equals k, value = 1 \
+ ",
Cell[BoxData[
\(TraditionalForm\`\((spaces\ filled\ by\ player' s\ marks)\)\^2\)]],
"\n6) if, along a vector, the sum of spaces filled by the opponent's marks \
plus free spaces equals k, value = ",
Cell[BoxData[
\(TraditionalForm\`\((spaces\ filled\ by\ opponent' s\ marks)\)\^2\)]],
".\nFor a given game board space, once ",
StyleBox["ScoreOnDimension[]", "Input"],
" has been applied for all four n = 2 vectors (or all thirteen n = 3 \
vectors), ",
StyleBox["TotalScore[]", "Input"],
" adds the ",
StyleBox["ScoreOnDimension[]", "Input"],
" output for each vector, and ",
StyleBox["FindBestScore[]", "Input"],
" takes the available game board space with the highest ",
StyleBox["TotalScore[]", "Input"],
" output."
}], "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell["PLAYING THE GAME", "Section"],
Cell[TextData[{
"A true benefit to working with TicTac.nb is learning about version 3.0 \
functions such as ",
StyleBox["ButtonBox[]", "Input"],
". In presenting the eight \"user interface\" buttons described above, and \
in creating the new Window in which the game board is presented, TicTac.nb \
makes extensive use of such functions. Alas, upon opening this notebook and \
first running a 2-D or 3-D \"Computer-Computer\" game, one gets a Mathematica \
error message about a string that causes a problem. A bit of probing reveals \
this problem to be with ",
StyleBox["ScoreOnDimension[]", "Input"],
". When your reviewer copied the functions in TicTac.nb and pasted them \
into a word processor file, all but one took on a normal appearance in that \
file. The exception was ",
StyleBox["ScoreOnDimension[]", "Input"],
": It was encased within the \"",
StyleBox["\\!\\(. . .\\)", "Input"],
"\" feature, and replete with ",
StyleBox["RowBox[]", "Input"],
" and ",
StyleBox["StyleBox[]", "Input"],
" functions . . . functions having ",
StyleBox["nothing",
FontSlant->"Italic"],
" to do with the duties of ",
StyleBox["ScoreOnDimension[]", "Input"],
". The \"",
StyleBox["\\(. . .\\)", "Input"],
"\" feature uses the textual input it contains to specify boxes for \
construction, and the \"",
StyleBox["\\!", "Input"],
"\" feature calls for interpreting the boxes (see p. 984 of the Mathematica \
book, third edition). But these features are clearly out of place in ",
StyleBox["ScoreOnDimension[]", "Input"],
". Their effect seems to be to prevent initial evaluation of ",
StyleBox["ScoreOnDimension[]", "Input"],
". With this vital function disabled, ",
StyleBox["FindBestScore[]", "Input"],
" can recommend only the next available game board space it encounters, and \
",
StyleBox["MakeDisplayCell[]", "Input"],
" cannot recognize k-in-a-row for X or O. \"Computer-Computer\" play in 2-D \
thus merely places alternating O and X marks in spaces from right to left, \
bottom to top. Here is the 2-D result (integers denote order of moves):"
}], "Text"],
Cell[BoxData[
TagBox[GridBox[{
{"O5", "X4", "O4"},
{"X3", "O3", "X2"},
{"O2", "X1", "O1"}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm]], "Output"],
Cell["\<\
TicTac.nb flags neither the diagonal O5-O3-O1 three-in-a-row nor the O2-O3-O4 \
three-in-a-row for first player O, and \"mindlessly\" continues play even \
after O wins with upper-right corner move O4.\
\>", "Text"],
Cell[TextData[{
"Fortunately, fixing ",
StyleBox["ScoreOnDimension[]", "Input"],
" seems to require as little as adding a superfluous space to one of its \
comment lines, and evaluating the resulting cell. What actually ails this \
function in TicTac.nb your reviewer still does not know, but at least the \
function can be made to work properly easily. And with its most important \
function now working properly, TicTac.nb plays ",
Cell[BoxData[
\(TraditionalForm\`3\^2\)]],
" and ",
Cell[BoxData[
\(TraditionalForm\`4\^3\)]],
" noughts and crosses as intended. For \"Human-Human\" play, ",
StyleBox["ScoreOnDimension[]", "Input"],
" is not needed, as two users place their marks in available spaces by \
clicking on those spaces; ",
StyleBox["MakeDisplayCell[]", "Input"],
" uses a red background to highlight k-in-a-row marks, declare a winner, \
and end the game. When playing for both O and X, TicTac.nb does not offer \
much variety to a spectator. Here are the outcomes of ",
StyleBox["every single",
FontSlant->"Italic"],
" 2-D and 3-D \"Computer-Computer\" game played by TicTac.nb (the numbers \
denote the order played; the first player is O):"
}], "Text"],
Cell[BoxData[
TagBox[GridBox[{
{"O5", "O4", "X2"},
{"X3", "O1", "O3"},
{"O2", "X4", "X1"}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm]], "Output"],
Cell[BoxData[
RowBox[{
TagBox[
StyleBox[GridBox[{
{"X4", " ", " ", "O4"},
{" ", " ", " ", " "},
{" ", " ", " ", " "},
{"X3", " ", " ", "O3"}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
DisplayForm],
TagBox[
StyleBox[GridBox[{
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ", " ",
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{" ", " ", " ", "X6"},
{" ", " ", " ", "X7"},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ", " ",
StyleBox["X8",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
DisplayForm],
TagBox[
StyleBox[GridBox[{
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ", " ",
StyleBox["O9",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{" ", " ", " ",
StyleBox["O7",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{" ", " ", " ",
StyleBox["O6",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ", " ",
StyleBox["O8",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
DisplayForm],
TagBox[
StyleBox[GridBox[{
{
StyleBox[
RowBox[{"X",
StyleBox["2",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]], " ", " ",
StyleBox[
RowBox[{"O",
StyleBox["2",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]]},
{" ", " ", " ",
StyleBox["X5",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{" ", " ", " ", "O5"},
{
StyleBox[
RowBox[{"X",
StyleBox["1",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]], " ", " ",
StyleBox[
RowBox[{"O",
StyleBox["1",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]]}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
DisplayForm]}]], "Input"],
Cell[TextData[{
"That TicTac.nb follows the same path with each game should not evoke \
surprise. No randomizing mechanism is built into its functions, and the rules \
followed by ",
StyleBox["ScoreOnDimension[]", "Input"],
" are static. Of course, two players rigidly following a minimax strategy \
[Nilsson 1980] would likewise follow the same path for each game (with \
possible allowances for symmetric spaces). In \"Computer-Human\" 2-D play, \
the program unfailingly takes center with the first move of each game, as \
would a player following a minimax strategy. Second player X can only respond \
by taking a corner or a side. For each response, here are the ",
StyleBox["TotalScore[]", "Input"],
" outputs for each space available for the second move of first player O:"
}], "Text"],
Cell[BoxData[
RowBox[{
StyleBox[
TagBox[GridBox[{
{
StyleBox["X",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["O",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " "}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[
TagBox[GridBox[{
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ",
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], "2"}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
TagBox[GridBox[{
{" ",
StyleBox["X",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{" ",
StyleBox["O",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " "},
{
StyleBox[
RowBox[{" ",
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " "}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm],
TagBox[GridBox[{
{
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ",
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["1",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm]}]], "Input"],
Cell[TextData[{
"Except for the bottom right corner in the first case, the corners come \
highly recommended for the second move by O. In the first case, O will then \
take the bottom left corner, forcing an upper-right corner block by X, \
forcing a top side block by O, forcing a bottom side block by X, allowing a \
left or right side move by O, and forcing a side move stalemating block by X. \
In the second case (since TicTac.nb evaluates available spaces right to left, \
bottom to top), O will take the bottom right corner, forcing a top-left \
corner block by X, forcing a top-right corner block by O which is also a \
winning trap for O. Note in the first case that had the second move by O been \
to the lower right corner (the \"weakest\" available space, given its lowest \
",
StyleBox["TotalScore[]", "Input"],
" value), and had X responded by taking any side for its second move, the \
third move by O could have been a winning trap. Tactics such as those of \
minimax and ",
StyleBox["ScoreOnDimension[]", "Input"],
" are incapable of such subtlety."
}], "Text"],
Cell[TextData[{
"In \"Human-Computer\" 2-D play, this lack of subtlety leads to the defeat \
of TicTac.nb. Let's say that, as first player O, the human follows Martin \
Gardner's advice and takes a corner for a first move. The highest ",
StyleBox["TotalScore[]", "Input"],
" then corresponds to the center, so second player X takes center. At this \
point, here are the game board and the ",
StyleBox["TotalScore[]", "Input"],
" values for the available board spaces:"
}], "Text"],
Cell[BoxData[
StyleBox[
RowBox[{
TagBox[GridBox[{
{
StyleBox["O",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["X",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " "}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm],
TagBox[GridBox[{
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ",
StyleBox["2",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["2",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], "2"}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm]}],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]], "Input"],
Cell["\<\
If the human player disregards these values and takes the bottom right corner \
as a second move, our situation becomes:\
\>", "Text"],
Cell[BoxData[
RowBox[{
StyleBox[
TagBox[
RowBox[{" ", GridBox[{
{
StyleBox[
RowBox[{"O",
StyleBox["1",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[
RowBox[{
StyleBox["X",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], "1"}]],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["O2",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True]}],
DisplayForm],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[
TagBox[GridBox[{
{
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}], " ",
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]},
{
StyleBox["4",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox["3",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}],
StyleBox[" ",
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}
},
RowSpacings->1.8,
ColumnSpacings->0.9,
RowAlignments->Center,
ColumnAlignments->{Center},
GridFrame->True,
RowLines->True,
ColumnLines->True],
DisplayForm],
FontWeight->"Plain",
FontSlant->"Plain",
FontTracking->"Plain",
FontVariations->{"Underline"->False,
"Outline"->False,
"Shadow"->False}]}]], "Input"],
Cell[TextData[{
"TicTac.nb will now force X to take a corner for its second move, allowing \
O to take the remaining corner for the block and the winning trap. But even \
the minimax strategy would have put X in a corner for its second move. As is \
shown both in this case and in the case where second player X takes a corner \
in response to a first player O center opening, these tactics have \
difficulties with defending against ",
StyleBox["and",
FontSlant->"Italic"],
" setting up the cornerstone move of rational noughts and crosses -- the \
trap. As part of his work with Qubic, Patashnik has amassed a sizable \
collection of successful moves and countermoves for this 4x4x4 version of \
noughts and crosses [Berlekamp ",
StyleBox["et al",
FontSlant->"Italic"],
" 1982]. A creative exercise would be to inflict this collection upon 3-D \
\"Human-Computer\" and \"Computer-Human\" TicTac.nb -- as well as upon a \
minimax-driven program -- and observe how this trap-blindness manifests \
itself given the added spatial dimension."
}], "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell["ASSESSMENT", "Section"],
Cell[TextData[{
"Jon McLoone's TicTac.nb has a befuddling (though easily \"solved\") \
problem with its cornerstone function, ",
StyleBox["ScoreOnDimension[]", "Input"],
", and it is a problem with which MathSource users should not have to deal. \
Within and in addition to ",
StyleBox["ScoreOnDimension[]", "Input"],
", the code within TicTac.nb contained far too few (* comments *) to \
constitute good documentation, especially for an author in the employ of \
Wolfram Research. The notebook's playing tactics are admittedly suspect. But \
the simple TicTac.nb strategy in no way discredits Jon McLoone, for his \
Modification Notes within TicTac.nb disclaim any sophistication on behalf of \
the simple tactics; in fact, those Notes actually invite more sophisticated \
tactics to be sent to McLoone. To his explicit credit, McLoone has built an \
excellent showcase for the new (to 3.0) \"box\"-based and \
Windows-manipulation functions: Mathematica workers wishing to build a \"user \
interface\" within a notebook have a very useful model in TicTac.nb."
}], "Text"],
Cell[TextData[{
"To the cynical \"The basic [noughts and crosses] strategy is sufficiently \
simple that bright chimpanzees have been trained to play with credible \
performance\" [Epstein 1977, p. 338], we offer Martin Gardner: \"I have \
observed that many ticktacktoe players are under the ",
StyleBox["mistaken",
FontSlant->"Italic"],
" [emphasis added] impression that because they can play an unbeatable \
strategy they have nothing more to learn about the game\" [Gardner 1959, p. \
45]. This legend from the pages of ",
StyleBox["Scientific American",
FontSlant->"Italic"],
" was referring primarily to the 3x3 game, but his words certainly also \
apply to Qubic and higher-dimension versions of the game. Given Mathematica's \
charter support of higher-dimension arrays, an enhanced version of TicTac.nb \
can help with this learning: Its 3-D features are ready-made for Qubic, and \
it can be readily made to address the k,n versions in the 1980 table from \
Patashnik. Perhaps it can even be extended to address the ",
StyleBox["\[GreaterEqual]100",
FontSlant->"Italic"],
"-dimension version of the game to which Beck's 1981 theorem applies. That \
extension, however, is left as an exercise for those singularly dedicated to \
\"stick[ing] one in the old man's crown\"."
}], "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell["REFERENCES", "Section"],
Cell[TextData[{
"Beck, J\[OAcute]zsef. \"On Positional Games\", ",
StyleBox["Journal of Combinatorial Theory, Series A",
FontSlant->"Italic"],
", ",
StyleBox["30",
FontSlant->"Italic"],
"(2), 117-133 (1981).\n\nBerlekamp, Elwyn R., Conway, John H. and Guy, \
Richard K. \"Lines and Squares\", Chapter Twenty-Two of ",
StyleBox[
"Winning Ways for Your Mathematical Plays (Volume 2: Games in Particular)",
FontSlant->"Italic"],
". Academic Press, London, 667-693 (1982).\n\nEpstein, Richard A. ",
StyleBox["The Theory of Gambling and Statistical Logic",
FontSlant->"Italic"],
". Academic Press, New York (1977).\n\nErd\[ODoubleDot]s, P. and Selfridge, \
J.L. \"On a Combinatorial Game\", ",
StyleBox["Journal of Combinatorial Theory, Series B",
FontSlant->"Italic"],
", ",
StyleBox["14",
FontSlant->"Italic"],
"(3), 298-301 (1973).\n\nGardner, Martin. \"Ticktacktoe\", Chapter Four of \
",
StyleBox[
"The Scientific American Book of Mathematical Puzzles & Diversions",
FontSlant->"Italic"],
". Simon and Schuster, New York, 37-46 (1959).\n\nHales, A.W. and Jewett, \
R.I. \"Regularity and Positional Games\", ",
StyleBox["Transactions of the American Mathematical Society",
FontSlant->"Italic"],
", ",
StyleBox["106",
FontSlant->"Italic"],
"(2), 222-229 (1963).\n\nMoser, Leo. \"Noughts and Crosses\", ",
StyleBox["American Mathematical Monthly",
FontSlant->"Italic"],
", ",
StyleBox["55",
FontSlant->"Italic"],
", 99 (February 1948). [Note: The Moser contribution is a solution to \
Elementary Problem 773 proposed by A.L. Rubinoff in the same journal, ",
StyleBox["54",
FontSlant->"Italic"],
", 281 (May 1947). Not only Moser but also Rubinoff and N.J. Fine are \
credited with solving E773 in February 1948; alas, only Moser's name seems to \
live on in association with that solution.]\n\nNilsson, Nils J. ",
StyleBox["Principles of Artificial Intelligence",
FontSlant->"Italic"],
". Tioga Publishing Co., Palo Alto, CA, 115-121 (1980).\n\nPatashnik, Oren. \
\"Qubic: 4x4x4 Tic-Tac-Toe\", ",
StyleBox["Mathematics Magazine",
FontSlant->"Italic"],
", ",
StyleBox["53",
FontSlant->"Italic"],
"(4), 202-216 (1980).\n\nPaul, Jerome L. \"Tic-Tac-Toe in n-Dimensions\", ",
StyleBox["Mathematics Magazine",
FontSlant->"Italic"],
", ",
StyleBox["51",
FontSlant->"Italic"],
"(1), 45-49 (1978).\n\nPaul, Jerome L. \"Partitioning the Lattice Points in \
",
Cell[BoxData[
\(TraditionalForm\`R\^n\)]],
"\", ",
StyleBox["Journal of Combinatorial Theory, Series A",
FontSlant->"Italic"],
", ",
StyleBox["26",
FontSlant->"Italic"],
"(3), 238-248 (1979)."
}], "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell["ABOUT THE AUTHOR", "Section"],
Cell[TextData[{
"Matthew M. Thomas completed his doctorate in chemical engineering at \
Washington University in St. Louis in December 1995. In early 1995, he \
co-wrote the \"Intelligent Control of Product Quality in Composite \
Manufacturing\" chapter of ",
StyleBox["Processing of Composites",
FontSlant->"Italic"],
", edited by Raju S. Dav\[EAcute] and Alfred C. Loos (Hanser Gardner \
Publishing, Cincinnati, 2000).\n\nthomas@wuche2.wustl.edu"
}], "Text"]
}, Open ]]
}, Open ]]
},
FrontEndVersion->"4.0 for Microsoft Windows",
ScreenRectangle->{{0, 1024}, {0, 695}},
WindowSize->{739, 545},
WindowMargins->{{0, Automatic}, {Automatic, 5}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic}
]
(***********************************************************************
Cached data follows. If you edit this Notebook file directly, not using
Mathematica, you must remove the line containing CacheID at the top of
the file. The cache data will then be recreated when you save this file
from within Mathematica.
***********************************************************************)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[1739, 51, 79, 3, 150, "Title"],
Cell[1821, 56, 40, 0, 64, "Subtitle"],
Cell[1864, 58, 261, 6, 52, "Text"],
Cell[2128, 66, 180, 7, 109, "Text"],
Cell[2311, 75, 770, 11, 128, "Text"],
Cell[CellGroupData[{
Cell[3106, 90, 29, 0, 53, "Section"],
Cell[3138, 92, 1286, 18, 204, "Text"],
Cell[4427, 112, 1288, 25, 166, "Text"],
Cell[5718, 139, 2758, 68, 265, "Text"],
Cell[8479, 209, 1690, 32, 204, "Text"],
Cell[10172, 243, 1685, 22, 242, "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell[11894, 270, 31, 0, 53, "Section"],
Cell[11928, 272, 1455, 26, 206, "Text"],
Cell[13386, 300, 4933, 129, 63, NotebookDefault,
Evaluatable->False,
CellGroupingRules->"NormalGrouping",
PageBreakAbove->True,
PageBreakWithin->False],
Cell[18322, 431, 1345, 28, 170, "Text"],
Cell[19670, 461, 2203, 52, 269, "Text"],
Cell[21876, 515, 1703, 37, 266, "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell[23616, 557, 35, 0, 53, "Section"],
Cell[23654, 559, 2119, 44, 269, "Text"],
Cell[25776, 605, 366, 13, 77, "Output"],
Cell[26145, 620, 225, 4, 52, "Text"],
Cell[26373, 626, 1210, 25, 150, "Text"],
Cell[27586, 653, 366, 13, 77, "Output"],
Cell[27955, 668, 7094, 198, 99, "Input"],
Cell[35052, 868, 802, 13, 130, "Text"],
Cell[35857, 883, 9664, 272, 77, "Input"],
Cell[45524, 1157, 1088, 18, 149, "Text"],
Cell[46615, 1177, 490, 9, 73, "Text"],
Cell[47108, 1188, 5079, 139, 76, "Input"],
Cell[52190, 1329, 144, 3, 33, "Text"],
Cell[52337, 1334, 6198, 165, 76, "Input"],
Cell[58538, 1501, 1069, 19, 147, "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell[59644, 1525, 29, 0, 53, "Section"],
Cell[59676, 1527, 1083, 17, 168, "Text"],
Cell[60762, 1546, 1320, 23, 166, "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell[62119, 1574, 29, 0, 53, "Section"],
Cell[62151, 1576, 2723, 74, 489, "Text"]
}, Open ]],
Cell[CellGroupData[{
Cell[64911, 1655, 35, 0, 53, "Section"],
Cell[64949, 1657, 470, 9, 109, "Text"]
}, Open ]]
}, Open ]]
}
]
*)
(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)