Beispiel #1
0
        public void GetReachebleHoles_TSpinAtTheRightBorder_OnePath()
        {
            var field = Field.Create(13, 0, 1, @"
				..........
				..........
				..........
				.XX.......
				XXXX.XX...
				XXXX.XX...
				XXXXXXX...
				XXXXXXX...
				XXXXXXX...
				XXXXXXX...
				XXXXXXX...
				XXXXXXX...
				XXXXXXXX..
				XXXXXXXX..
				XXXXXXX...
				XXXXXXXX.X
				X.XXXX.XXX
				XX.XXXXXXX"                );

            var act = MoveGenerator.GetReachableHoles(field, Block.T).Select(move => move.ToString()).ToArray();
            var exp = new string[]
            {
                "down,down,down,right,right,right,right,down,down,down,down,down,down,down,down,turnright,down,down,down,turnleft",
                "down,down,down,right,right,right,right,down,down,down,down,down,down,down,down,turnright,down,down,down,turnleft,turnleft",
                "down,down,down,right,right,right,right,down,down,down,down,down,down,down,down,turnright,down,down,down,turnright"
            };

            CollectionAssert.AreEqual(exp, act);
        }
Beispiel #2
0
        public void GetReachableHoles_HolesNotReachableBecauseTurn_False()
        {
            var field = Field.Create(0, 0, 0, @"
..........
..........
..........
XXXXXX...X
XXXX...XXX
XXXXXX..XX
XXXXXX..X.
");
            var act   = MoveGenerator.GetReachableHoles(field, Block.O).ToList();
            var exp   = new List <MoveCandiate>();

            CollectionAssert.AreEqual(exp, act);
        }
Beispiel #3
0
        public void GetReachableHoles_HolesReachable_4()
        {
            var field = Field.Create(0, 0, 0, @"
..........
..........
..........
XXXXXX..XX
XXXXX...X.
XXXXXX..XX
XXXXXX..X.
");
            var act   = MoveGenerator.GetReachableHoles(field, Block.T).Select(c => c.Path.ToString()).ToArray();
            var exp   = new string[]
            {
                "down,down,right,right,right,turnleft,down,down,left",
                "down,down,right,right,right,turnleft,down,down,left,turnleft",
                "down,down,right,right,right,turnleft,down,down,left,turnright"
            };

            CollectionAssert.AreEqual(exp, act);
        }