private void BoardControl_Paint(object sender, PaintEventArgs e) { g = e.Graphics; for (int col = 0; col < _boardDimension; col++) { for (int row = 0; row < _boardDimension; row++) { if (brd.getCellState(col, row)) { g.FillRectangle(brush1, col * (cellWidth + panelWidth), row * (cellHeight + panelWidth), cellWidth, cellHeight); } else { g.DrawRectangle(pen1, col * (cellWidth + panelWidth), row * (cellHeight + panelWidth), cellWidth, cellHeight); } } } }
public void TestRule3() { brd.setCells(1, 1, new bool[] { true, true, true, true, true, false, false, false, false }); brd.iterate(); Assert.IsTrue(brd.getCellState(1, 1) == false); }