In[]:=
NimMoves[list:{_Integer..}]:=Catenate[Table[If[list[[i]]0,Nothing,ReplacePart[list,i#]&/@Range[0,list[[i]]-1]],{i,Length[list]}]]
In[]:=
NimMoves[(list:{_Integer..}),maxdelta_Integer]:=Catenate[Table[If[list[[i]]0,Nothing,ReplacePart[list,i#]&/@Range[list[[i]]-maxdelta,list[[i]]-1]],{i,Length[list]}]]
In[]:=
NimMoves[{3,2,1}]
Out[]=
{{0,2,1},{1,2,1},{2,2,1},{3,0,1},{3,1,1},{3,2,0}}
In[]:=
ResourceFunction["MultiwaySystem"][<|"StateEvolutionFunction"NimMoves,"StateEquivalenceFunction"SameQ,"StateEventFunction"Identity,"EventDecompositionFunction"Identity,"EventApplicationFunction"Identity,"SystemType""None","EventSelectionFunction"Identity|>,{{3,2,1}},4,"StatesGraph","StateRenderingFunction"(Inset[Style[Row[#2],Black],#1,BackgroundLighter[Blue,.9]]&)]
Out[]=
Hackenbush
Hackenbush
In[]:=
Table[Mod[n,2,1],{n,50}]
Out[]=
{1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
In[]:=
rg=RandomGraph[{40,80}]
Out[]=
In[]:=
Graph[rg,EdgeStyle(#->RandomChoice[{Red,Blue}]&/@EdgeList[rg])]
Out[]=
In[]:=
EdgeDelete[%,RandomChoice[EdgeList[%]]]
Out[]=
[[ Tic Tac Toe : not equivalent to Hackenbush ]]
Toads and Frogs
Toads and Frogs
1D sliding block, 2-player game, with a jumping rule
{1,0,0,2,0}
Turning Turtles
Turning Turtles
[ What is multiway graph? ]
Gives Golay codes /