Example #1
0
        public void SurroundTestTopRightCorner()
        {
            LifeGame test = new LifeGame(25);

            int[] cells = test.SurrondingCells(4); //Top left corner test
            Assert.Equal(0, cells[1]);             // Right
            Assert.Equal(3, cells[0]);             // left
            Assert.Equal(24, cells[2]);            // top
            Assert.Equal(9, cells[5]);             // bottom
            Assert.Equal(23, cells[3]);            // top left
            Assert.Equal(20, cells[4]);            // top right
            Assert.Equal(8, cells[6]);             // bottom left
            Assert.Equal(5, cells[7]);             // bottom right
        }
Example #2
0
        public void SurroundTestBottomLeftCorner()
        {
            LifeGame test = new LifeGame(36);

            int[] cells = test.SurrondingCells(30); //bottom left corner test
            Assert.Equal(31, cells[1]);             // Right
            Assert.Equal(35, cells[0]);             // left
            Assert.Equal(24, cells[2]);             // top
            Assert.Equal(0, cells[5]);              // bottom
            Assert.Equal(29, cells[3]);             // top left
            Assert.Equal(25, cells[4]);             // top right
            Assert.Equal(5, cells[6]);              // bottom left
            Assert.Equal(1, cells[7]);              // bottom right
        }
Example #3
0
        public void SurroundTest()
        {
            LifeGame test = new LifeGame(25);

            int[] cells = test.SurrondingCells(22); //Bottom square test
            Assert.Equal(23, cells[1]);             // Right
            Assert.Equal(21, cells[0]);             // left
            Assert.Equal(17, cells[2]);             // top
            Assert.Equal(2, cells[5]);              // bottom
            Assert.Equal(16, cells[3]);             // top left
            Assert.Equal(18, cells[4]);             // top right
            Assert.Equal(1, cells[6]);              // bottom left
            Assert.Equal(3, cells[7]);              // bottom right
        }