示例#1
0
 public MoveTree( int gridSize )
 {
     GridSize = gridSize;
      _root = new Treenode();
      _root.AddLeftTurn();
      _root.AddRightTurn();
 }
示例#2
0
        public void Treenode_WhenAddingRightTurn_ChildIncrementsRightTurnCount()
        {
            var root = new Treenode { Name = "" };
             var child = root.AddRightTurn();

             Assert.AreEqual(root.RightTurns + 1, child.RightTurns);
             Assert.AreEqual(child.Name, "R");
        }
示例#3
0
 public Treenode AddRightTurn()
 {
     var node = new Treenode()
      {
     Name = this.Name + "R",
     RightTurns = this.RightTurns + 1,
     LeftTurns = this.LeftTurns
      };
      this.RightChild = node;
      return node;
 }