Ejemplo n.º 1
0
        public GoTop()
        {
            d_boardModel = new BoardModel(19);
            d_groups = new Groups();

            Contract.Ensures(d_groups.count == 0);
        }
Ejemplo n.º 2
0
        public static void ClassInit(TestContext context)
        {
            ds_sz = 19;
            ds_boardModel = new BoardModel(ds_sz);

            Assert.IsTrue(BoardModelUtil.IsEmpty(ds_boardModel));
        }
Ejemplo n.º 3
0
 public static bool IsEmpty(BoardModel bm)
 {
     for (int row = 1; row <= bm.width; row++)
     {
         for (int col = 1; col <= bm.width; col++)
         {
             if (bm.GetCell(row, col) != CellState.EMPTY)
             {
                 return false;
             }
         }
     }
     return true;
 }
Ejemplo n.º 4
0
 public static string GetCellLabel(BoardModel bm, int row, int col)
 {
     return CellStateToString(bm.GetCell(row, col)) + row + ":" + col;
 }
Ejemplo n.º 5
0
        public static void GenerateRandomConfiguration(int numPoints, BoardModel bm)
        {
            Random rnd = new Random();

            for (int ii = 0; ii < numPoints; ii++)
            {
                int row = rnd.Next() % bm.width + 1;
                int col = rnd.Next() % bm.width + 1;
                golib.CellState st = IndexToState(rnd.Next() % 3);

                bm.SetCell(st, row, col);
            }
        }
Ejemplo n.º 6
0
 public static void ClearBoard( BoardModel bm )
 {
     for (int ii = 1; ii <= bm.width; ++ii)
     {
         for (int jj = 1; jj <= bm.width; ++jj)
         {
             bm.ClearCell(ii, jj);
         }
     }
 }
Ejemplo n.º 7
0
 public static void ClassInit(TestContext context)
 {
     ds_sz = 19;
     ds_boardModel = new BoardModel(ds_sz);
 }