Posted on April 26, 2010.
Java - problem encoding - NumberFormateException? It is a game of sudoku, the methods are all correct (I have omitted)
The problem is that I can not get my battery to work.
I want to create a stack of int [paintings]] [, and when the user enters "return"
I want the stack of pop, then I print.
I go back, but each, it returns an error NumberFormatException.
can someone tell me what's wrong? I'ved asterisks added for parties problem, much is not necessary to understand the problem, I think. Excuse the poor formatting ... it is wasted here.
public static void main (String [] args) (
/ / Create Basic Sudoku 9X9 NETWORK
String [] [] = (sudoku
("," "," 8 "," "," 2 "," 6 "," "," "," 1 ")
("9" "" "" "1" "" "" "" "" "")
("," "," 5 "," 3 "," 9 "," "," "," 6 "," ")
("3", "", "", "2", "", "", "", "7", "")
("7", "", "2", "", "", "", "5", "", "4")
("," 6 "," "," "," "," 4 "," "," "," 3 ")
("," 8 "," "," "," 3 "," 2 "," 1 "," "," ")
("" "" "" "" "" 7 "" "" "" 9 ")
("5", "", "", "8", "6", "", "3", "", "")
)
/ / Creating ORIGINAL SUDOKU 9X9
int [] [] = (original_sudoku
(0,0,8,0,2,6,0,0,1)
(9,0,0,1,0,0,0,0,0)
(0,0,5,3,9,0,0,6,0)
(3,0,0,2,0,0,0,7,0)
(7,0,2,0,0,0,5,0,4)
(0,6,0,0,0,4,0,0,3)
(0,8,0,0,3,2,1,0,0)
(0,0,0,0,0,7,0,0,9)
(5,0,0,8,6,0,3,0,0)
)
*** / / INITIALIZATION battery to Cancel Order
*** SudokuStack Stack = new Stack <int[][]> <int[][]> ();
*** SudokuStack.push (original_sudoku);
System.out.println ("Welcome to a game (ADB) Sudoku !!");
JOptionPane.showMessageDialog («... the null +
"Address and the number to insert, use the" +
"Nx \, y, the number \ n x-axis is 1-9 lr" +
"\ N the y axis is up and down 1-9" +
"\ N uppermostleft box is 1.1, #" +
"\ N enter \" Back \ "to go back one step");
print (sudoku);
/ / Ask the opinion
int count = 30, / / initial number of given numbers
while (<counter = 81) (
scanner = new Scanner (System.in);
String input = scanner.next ();
** If (input.equalsIgnoreCase ("back")) (
** Int [] [] = split sudokuStack.pop ();
Print ** (maize);
cons -;
)
** If (entry! = "Return") (
String [] = shuru input.split (",", 3);
xcoor int = Integer.parseInt (shuru [0]) -1;
Ycoor int = Integer.parseInt (shuru [1]) -1;
inputnumber int = Integer.parseInt (shuru [2]);
if (checkRow (original_sudoku, Ycoor, inputnumber) == true & & checkColumn (original_sudoku, xcoor, inputnumber) == true & & checkbox (original_sudoku, xcoor, Ycoor, inputnumber) == true) (
original_sudoku [Ycoor] [xcoor] = inputnumber;
sudokuStack.push (original_sudoku);
System.ou.