public long NextMove()
        {
            if (currentNode == null)
            {
                foreach (MoveNode node in children)
                {
                    if (node.alive)
                    {
                        currentNode = node;
                        break;
                    }
                }
            }
            else
            {
                currentNode = currentNode.NextAvailableChild();
            }

            if (++currentDepth > recordDepth)
            {
                recordDepth = currentDepth;
                Console.WriteLine($"New Record Depth: {currentDepth}");
            }

            return(currentNode.direction);
        }
 public MoveNode(MoveNode parent, int direction)
 {
     this.parent    = parent;
     this.direction = direction;
 }
 public void MarkFailure()
 {
     currentNode.MarkDead();
     currentNode  = null;
     currentDepth = 0;
 }