package games;

import stdlib.Color;
import stdlib.StdDraw;

/*************************************************************************
 *  Compilation:  javac CheckerBoard.java 
 *  Execution:    java CheckerBoard N
 *  Dependencies: StdDraw.java
 *
 *  Plots an N-by-N checker board.
 *
 *************************************************************************/

public class CheckerBoard { 

    public static void main(String[] args) { 
//        int N = Integer.parseInt(args[0]);
        int N = 8;
        StdDraw sd = new StdDraw();
        sd.setXscale(0, N);
        sd.setYscale(0, N);

        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if ((i + j) % 2 != 0) sd.setPenColor(Color.BLACK);
                else                  sd.setPenColor(Color.DARK_RED);
                sd.filledSquare(i + .5, j + .5, .5);
            }
        }
        StdDraw.show();
    }

}