コード例 #1
0
        //creates a new blcok, and a grid out of blocks
        public void NewGame()
        {
            Minesweeper.Block blocky = new Minesweeper.Block(0, false, true);

            //make a grid with bombs and the numbers
            gridy = new Gridy(blocky, MyVariables.row, MyVariables.column);
            gridy.MineIt(MyVariables.mine);
            gridy.NumberIt();
            gridy.RemainingBombsCount();

            stopWatch.Start();
            dt.Start();
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: meinik/GameMinesweeper
        //Creates a grid, selects a position and verifies the Mine value is not 9,
        // then mines the whole grid and verified the same position Mine value is 9
        public void AssertMines()
        {
            int  mine   = 0;
            bool flag   = false;
            bool hide   = true;
            int  row    = 2;
            int  column = 2;
            int  mines  = 4;

            Block block1 = new Block(mine, flag, hide);
            Gridy grid1  = new Gridy(block1, row, column);

            Assert.AreNotEqual(9, grid1.theGrid[0, 0].Mine);

            grid1.MineIt(mines);
            Assert.AreEqual(9, grid1.theGrid[0, 0].Mine);
        }