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]:=

BCK[{A_, s_}, n_Integer, {Eview_, Aview_, CurrentPlay_}] := CompoundExpression[DrawTre ... tinues from the next position *)BCK[{Anext, signnext}, n + 1, newstate[n]] ; ]]] ;

These are the output message saying that p drops out, or makes an irregular move, hence loses.

In[338]:=

DropOut[p_] := CompoundExpression[Print[PlayerLogo[p], " gives up."] ;  ++Score[Opponent[p]] ; GameEnd[] ;]

In[339]:=

IrregularMove[p_] := CompoundExpression[Print[PlayerLogo[p], " do ... ogo[p], " loses."],  ++Score[Opponent[p]] ; GameEnd[] ;]

This is the front end of backtracking. We ask the node p backtracks to.

In[340]:=

BacktrackFrontEnd[p_, n_, {Eview_, Aview_, CurrentPlay_}, bckpos_]     := Compo ... rs a non-visible node (irregular move)."], IrregularMove[p]]]]] ; ] ;


Created by Mathematica  (October 17, 2006)