<commit_before>package com.wvu.ai.csp.project.SudokuSolver;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
/**
 * Created by <NAME> on 4/9/16.
 */
public class App {
    private static int SIZE;
    static  Scanner kbd = new Scanner(System.in);

    public static void main(String[] args){
        Board sudokuBoard;
        int possibleSize;
        boolean validSize = false;

        System.out.println("What size sudoku board would you like? Enter in a number that is a perfect square.\n" +
                "The normal sudoku board is a 9 by 9 board.");
        while(!validSize){

            possibleSize = kbd.nextInt();
            if((long)Math.sqrt(possibleSize) * (long)Math.sqrt(possibleSize) == possibleSize){
                SIZE = possibleSize;
                validSize = true;
            }else{
                validSize = false;
                System.out.print("That size is not a perfect square, please select a different size.\n");
            }
        }

        System.out.println("Create your sudoko table by entering the cells. " +
                "\nEnter the entire top row then hit enter." +
                "\nEach cell should contain only a digit between 1-" + SIZE + ". " +
                "\nIf the cell is meant to be blank, enter a zero.");
        sudokuBoard = generateUserSudokuBoard();
        System.out.print(sudokuBoard.toString());

    }

    public static Board generateUserSudokuBoard(){
        Board newBoard = new Board(SIZE);

        for(int row = 0; row < SIZE; row++){
            for(int col = 0; col < SIZE; col++) {

                int inputValue = kbd.nextInt();

                if (inputValue >= 0 && inputValue <= SIZE) {
                    newBoard.addCell(inputValue, row, col);
                } else{
                    //Number is too large, reset everything
                    System.out.println("Invalid number passed in. Restarting.");
                    row = 0;
                    col = 0;
                    newBoard = new Board(SIZE);
                }<commit_msg>Set scanner to private and closed it.<commit_after>package com.wvu.ai.csp.project.SudokuSolver;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
/**
 * Created by <NAME> on 4/9/16.
 */
public class App {
    private static int SIZE;
    private static Scanner KBD = new Scanner(System.in);

    public static void main(String[] args){
        Board sudokuBoard;
        int possibleSize;
        boolean validSize = false;

        System.out.println("What size sudoku board would you like? Enter in a number that is a perfect square.\n" +
                "The normal sudoku board is a 9 by 9 board.");
        while(!validSize){

            possibleSize = KBD.nextInt();
            if((long)Math.sqrt(possibleSize) * (long)Math.sqrt(possibleSize) == possibleSize){
                SIZE = possibleSize;
                validSize = true;
            }else{
                validSize = false;
                System.out.print("That size is not a perfect square, please select a different size.\n");
            }
        }

        System.out.println("Create your sudoko table by entering the cells. " +
                "\nEnter the entire top row then hit enter." +
                "\nEach cell should contain only a digit between 1-" + SIZE + ". " +
                "\nIf the cell is meant to be blank, enter a zero.");
        sudokuBoard = generateUserSudokuBoard();
        System.out.print(sudokuBoard.toString());
        KBD.close();
    }

    public static Board generateUserSudokuBoard(){
        Board newBoard = new Board(SIZE);

        for(int row = 0; row < SIZE; row++){
            for(int col = 0; col < SIZE; col++) {

                int inputValue = KBD.nextInt();

                if (inputValue >= 0 && inputValue <= SIZE) {
                    newBoard.addCell(inputValue, row, col);
                } else{
                    //Number is too large, reset everything
                    System.out.println("Invalid number passed in. Restarting.");
                    row = 0;
                    col = 0;
                    newBoard = new Board(SIZE);
                }
{'fraction_non_alphanumeric': 0.10326981886614914, 'fraction_numerical': 0.0056457304163726185, 'mean_word_length': 1.7485455720749838, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1085127', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1102, 'n_words': 368}