Ejemplo n.º 1
0
        public void TestCanPlayThere()
        {
            var board = new RevGame();

            bool actual = board.CanPlayThere(board.CurrentPlayer, 5, 4);
            bool expected = true;

            Assert.AreEqual(expected, actual);

            actual = board.CanPlayThere(board.CurrentPlayer, 5, 3);
            expected = false;

            Assert.AreEqual(expected, actual);

            actual = board.CanPlayThere(board.CurrentPlayer, 0, 0);
            expected = false;

            Assert.AreEqual(expected, actual);

            actual = board.CanPlayThere(board.CurrentPlayer, 4, 4);
            expected = false;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        protected Dictionary<Coord, int> MakeListOfPossiblePlays(Player p, RevGame game)
        {
            int col = 8;
            int row = 8;
            Dictionary<Coord,int> d = new Dictionary<Coord, int>();

            for (int i = 0; i < col; i++)
            {
                for (int j = 0; j < row; j++)
                {
                    if (game.CanPlayThere(p, i, j))
                    {
                        var tokens = game.MakeListOfConvertedTokens(p, i, j);
                        d[new Coord(i,j)] = tokens.Count();
                    }
                }
            }
            return d;
        }