예제 #1
0
 private static void Setup() { //I think this needs more for loops.
     int tileNumber = 0;
     for(int y = 0;y < BoardSize;y += 1) {
         for(int x = 0;x < BoardSize;x += 1) {
             if(IsOdd(tileNumber)) {
                 _Board[x,y] = Tile.White;
             } else {
                 _Board[x,y] = Tile.Black;
             }
             tileNumber += 1;
         }
         tileNumber += 1;
     }
     for(int y = 0;y < 2;y += 1) {
         for(int x = 0;x < BoardSize;x += 1) {
             if(Board(x,y) == Tile.Black) {
                 _Board[x,y] = Tile.RedChecker;
             }
         }
     }
     for(int y = BoardSize-1;y > BoardSize-3;y -= 1) {
         for(int x = 0;x < BoardSize;x += 1) {
             if(Board(x,y) == Tile.Black) {
                 _Board[x,y] = Tile.WhiteChecker;
             }
         }
     }
     Bot1.Setup(1,BoardSize);
     Bot2.Setup(2,BoardSize);
     checkerBoard = new CheckerBoard(BoardSize);
     new Thread(RunCheckerBoard).Start();
     checkerBoard.UpdateBoard(_Board);
 }