public void printNQueens(int [] locations) {
        System.out.print("=======================\n");
        for (int i=0; i<locations.length; i++) {
            int location = locations[i];
            for (int j=0; j<locations.length; j++) {
                if (j != location) {
                    System.out.print(". ");
                } else {
                    System.out.print("* ");
                }
            }
            System.out.print("\n");
        }
        System.out.print("=======================\n");
    }