// ITI1120  A 4
// Names: Daniel Amyot, 1234567
//        Diana Inkpen, 7654321
// This program generate a sudoku grid and allows
// a player to try to solve it.

import java.awt.Container;
import javax.swing.JFrame;

public class Sudoku extends JFrame {
  
  public static void main(String[] args) {  

    // GIVENS
    int grid[][]; // the Sudoku grid
    boolean constraintsConfig[][] = new boolean [9][9];  
         // Contains true for the positions where there was an initial value

    // BODY
    // Generate a new Sudoku grid
    grid = SudokuLib.generateSudoku(constraintsConfig);

    // Create the main window of the game and adds its title
    JFrame window = new Sudoku();
    window.setTitle("ITI 1120 Sudoku!!!");
    
    // Adds the user interface to the game in the window
    SudokuUI userInterface = new SudokuUI(grid, constraintsConfig);
    Container contentPane = window.getContentPane();
    contentPane.add(userInterface);
    
    // Display the window... Now you can play!
    window.pack();
    window.setVisible(true);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);    
  }
  
}
