Defining the main program.
This is the recursive definition of BCK[.]. At each step, the player moving next can also drop out of the play and lose, or backtrack to some previous node in the displayed tree.
In[337]:=
These are the output message saying that p drops out, or makes an irregular move, hence loses.
In[338]:=
In[339]:=
This is the front end of backtracking. We ask the node p backtracks to.
In[340]:=
Created by Mathematica (October 17, 2006)