示例#1
0
文件: Grid.cs 项目: nwrush/GameOfLife
 public static void Create()
 {
     for (int row = 0; row <= Grid.grid.GetLength(0)-1; row++)
     {
         for (int col = 0; col <= Grid.grid.GetLength(1)-1; col++)
         {
             grid[row, col] = new Cell(true, row, col);
         }
     }
 }
示例#2
0
 private static Cell[,] getGrid(List<Cell> cells, int r, int c)
 {
     Cell[,] temp = new Cell[r, c];
     int i = 0;
     for (int row = 0; row <= r-1; row++)
     {
         for (int col = 0; col <= c-1; col++)
         {
             temp[row, col] = cells[i++];
         }
     }
     return temp;
 }