src/main/java/com/webcheckers/model/CheckerBoard.java
public void initializeBoard(){
        Row row1=new Row(0);
        Row row2=new Row(1);
        Row row3=new Row(2);
        Row row4=new Row(3);
        Row row5=new Row(4);
        Row row6=new Row(5);
        Row row7=new Row(6);
        Row row8=new Row(7);
        for (int i=0;i<COLS;i++){
            if (i%2==0){
                row1.addSpace(new Space(i, Spot.WHITE, 0));
                row2.addSpace(new Space(i, Spot.BLACK, 1));
                row3.addSpace(new Space(i, Spot.WHITE, 2));
                row4.addSpace(new Space(i, Spot.BLACK, 3));
                row5.addSpace(new Space(i, Spot.WHITE, 4));
                row6.addSpace(new Space(i, Spot.BLACK, 5));
                row7.addSpace(new Space(i, Spot.WHITE, 6));
                row8.addSpace(new Space(i, Spot.BLACK, 7));
            }
            else{
                row1.addSpace(new Space(i, Spot.BLACK, 0));
                row2.addSpace(new Space(i, Spot.WHITE, 1));
                row3.addSpace(new Space(i, Spot.BLACK, 2));
                row4.addSpace(new Space(i, Spot.WHITE, 3));
                row5.addSpace(new Space(i, Spot.BLACK, 4));
                row6.addSpace(new Space(i, Spot.WHITE, 5));
                row7.addSpace(new Space(i, Spot.BLACK, 6));
                row8.addSpace(new Space(i, Spot.WHITE, 7));
            }
        }
        boardView.addRow(row1);
        boardView.addRow(row2);
        boardView.addRow(row3);
        boardView.addRow(row4);
        boardView.addRow(row5);
        boardView.addRow(row6);
        boardView.addRow(row7);
        boardView.addRow(row8);
    }
/**
     * Initializes the board with black and white spaces
     */
Initializes the board with black and white spaces
Initializes the board with black and white spaces
public void initializeBoard(){
        Row row1=new Row(0);
        Row row2=new Row(1);
        Row row3=new Row(2);
        Row row4=new Row(3);
        Row row5=new Row(4);
        Row row6=new Row(5);
        Row row7=new Row(6);
        Row row8=new Row(7);
        for (int i=0;i<COLS;i++){
            if (i%2==0){
                row1.addSpace(new Space(i, Spot.WHITE, 0));
                row2.addSpace(new Space(i, Spot.BLACK, 1));
                row3.addSpace(new Space(i, Spot.WHITE, 2));
                row4.addSpace(new Space(i, Spot.BLACK, 3));
                row5.addSpace(new Space(i, Spot.WHITE, 4));
                row6.addSpace(new Space(i, Spot.BLACK, 5));
                row7.addSpace(new Space(i, Spot.WHITE, 6));
                row8.addSpace(new Space(i, Spot.BLACK, 7));
            }
            else{
                row1.addSpace(new Space(i, Spot.BLACK, 0));
                row2.addSpace(new Space(i, Spot.WHITE, 1));
                row3.addSpace(new Space(i, Spot.BLACK, 2));
                row4.addSpace(new Space(i, Spot.WHITE, 3));
                row5.addSpace(new Space(i, Spot.BLACK, 4));
                row6.addSpace(new Space(i, Spot.WHITE, 5));
                row7.addSpace(new Space(i, Spot.BLACK, 6));
                row8.addSpace(new Space(i, Spot.WHITE, 7));
            }
        }
        boardView.addRow(row1);
        boardView.addRow(row2);
        boardView.addRow(row3);
        boardView.addRow(row4);
        boardView.addRow(row5);
        boardView.addRow(row6);
        boardView.addRow(row7);
        boardView.addRow(row8);
    }
public void initializeBoard ( ) { Row row1 = new Row ( 0 ) ; Row row2 = new Row ( 1 ) ; Row row3 = new Row ( 2 ) ; Row row4 = new Row ( 3 ) ; Row row5 = new Row ( 4 ) ; Row row6 = new Row ( 5 ) ; Row row7 = new Row ( 6 ) ; Row row8 = new Row ( 7 ) ; for ( int i = 0 ; i < COLS ; i ++ ) { if ( i % 2 == 0 ) { row1 . addSpace ( new Space ( i , Spot . WHITE , 0 ) ) ; row2 . addSpace ( new Space ( i , Spot . BLACK , 1 ) ) ; row3 . addSpace ( new Space ( i , Spot . WHITE , 2 ) ) ; row4 . addSpace ( new Space ( i , Spot . BLACK , 3 ) ) ; row5 . addSpace ( new Space ( i , Spot . WHITE , 4 ) ) ; row6 . addSpace ( new Space ( i , Spot . BLACK , 5 ) ) ; row7 . addSpace ( new Space ( i , Spot . WHITE , 6 ) ) ; row8 . addSpace ( new Space ( i , Spot . BLACK , 7 ) ) ; } else { row1 . addSpace ( new Space ( i , Spot . BLACK , 0 ) ) ; row2 . addSpace ( new Space ( i , Spot . WHITE , 1 ) ) ; row3 . addSpace ( new Space ( i , Spot . BLACK , 2 ) ) ; row4 . addSpace ( new Space ( i , Spot . WHITE , 3 ) ) ; row5 . addSpace ( new Space ( i , Spot . BLACK , 4 ) ) ; row6 . addSpace ( new Space ( i , Spot . WHITE , 5 ) ) ; row7 . addSpace ( new Space ( i , Spot . BLACK , 6 ) ) ; row8 . addSpace ( new Space ( i , Spot . WHITE , 7 ) ) ; } } boardView . addRow ( row1 ) ; boardView . addRow ( row2 ) ; boardView . addRow ( row3 ) ; boardView . addRow ( row4 ) ; boardView . addRow ( row5 ) ; boardView . addRow ( row6 ) ; boardView . addRow ( row7 ) ; boardView . addRow ( row8 ) ; }
Initializes the board with black and white spaces
Initializes the board with black and white spaces