Ejemplo n.º 1
0
        public void _2048ModelTest2()
        {
            var model = new _2048Model(0);

            EMCTSGame.SeedRandom(0);
            var moves = model.RandomFinish();

            Trace.Write(model.Matrix.ToDebugString(5));
            Assert.IsFalse(model.IsAutoMovePossible);
            Assert.AreEqual(0, model.PossibleMoves);
            Assert.IsFalse(model.Matrix.TraverseByRows().Any((v) => v.Value == 0));
        }
Ejemplo n.º 2
0
 public void _2048ModelTest3()
 {
     for (int counter = 0; counter < 1000; ++counter)
     {
         var model = new _2048Model();
         var moves = model.RandomFinish();
         Trace.Write(model.Matrix.ToDebugString(5));
         Assert.IsFalse(model.IsAutoMovePossible);
         Assert.AreEqual(0, model.PossibleMoves);
         if (model.PlayersATurn)
         {
             Assert.IsFalse(model.MoveDown());
             Assert.IsFalse(model.MoveUp());
             Assert.IsFalse(model.MoveLeft());
             Assert.IsFalse(model.MoveRight());
         }
         Assert.IsFalse(model.Matrix.TraverseByRows().Any((v) => v.Value == 0));
     }
 }