ArrayIndexOutOfBoundsException

Somtimes runs (I just keep hitting the Run button over and over), sometimes doesn't.

When it doesn't Errors Given:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 19

at SudokuApp.<init>(SudokuApp.java:93)

at SudokuApp.main(SudokuApp.java:104)

where 19 is currently, changes each time I try to run it in eclipse

Code:

...

publicstaticvoid main(String[] args){

new SudokuApp();

}

public SudokuApp(){

super();

this.initComponents();

}

privatevoid initComponents(){

this.setSize(APP_WIDTH, APP_HEIGHT);

this.show();

}

/** Draw the JFrame.

* @param gfx the Graphics object to which we'll draw.

*/

publicvoid paint(Graphics gfx){

super.paint(gfx);

// Draw the Board

this.drawBoard();

}

...

I'm not using a command line and not passing anything in. I'm not using the args[] array from the main function and If I could get rid of it, I think I would, but I think it needs to be in there.

Any help would be appreciated

Message was edited by:

nshenry03

[1776 byte] By [nshenry03a] at [2007-11-26 16:29:56]
# 1
The error is occuring at line 93, not 19. Post the code around there.
CaptainMorgan08a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 2

I actually don't have a line 93 (sorry, probably a stupid answer). In my program in Eclipse, the line numbers jump from [86, 103]. At 103 I have the

public static void main (String[] args){

...

}

before that I (lines 27-85) I have 4 very simular arrays that look like:

public static int [][] solns =

{

{6, 3, 7, 2, 5, 9, 8, 4, 1, 4, 9, 5, 8, 7, 1, 3, 2, 6, 8, 1, 2, 4, 6, 3, 9, 5, 7, 2, 8, 9, 5, 1, 4, 7, 6, 3, 3, 7, 1, 6, 9, 2, 5, 8, 4, 5, 6, 4, 3, 8, 7, 1, 9, 2, 7, 5, 8, 1, 4, 6, 2, 3, 9, 1, 2, 6, 9, 3, 5, 4, 7, 8, 9, 4, 3, 7, 2, 8, 6, 1, 5},

{3, 4, 1, 7, 6, 2, 9, 8, 5, 5, 6, 7, 3, 8, 9, 1, 4, 2, 2, 8, 9, 1, 5, 4, 6, 7, 3, 1, 3, 5, 9, 2, 7, 8, 6, 4, 4, 9, 6, 5, 1, 8, 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6, 9, 4, 5, 1, 3, 7}

};

nshenry03a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 3
holy ****. is that how your write a sudoku app? !? !?when you say your numbers jump from 86-103, are you sure that you dont have some piece of code collapsed/hidden in there?Message was edited by: TimSparq
TimSparqa at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 4
<shudders/>Alright. You are getting the Exception while trying to access one of those array. You need to figure out where that is happening.
CaptainMorgan08a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 5

> <shudders/>

Me too! :), joined class late and now I'm playing catch up

Only Place either of the four MD arrays are called, it's got to be this one:

// Draw the given numbers.

// Set initial loop conditions.

int lineCounterX = 0;

int lineCounterY = 0;

int iterator = 0;

startX = 55;

startY = 185;

// Use a loop to draw the numbers.

while (lineCounterY < 9) {

while (lineCounterX < 9) {

// Draw the number.

workAreaGfx.drawString(StringPuzzles[randomIndex][iterator], startX, startY);

// Move over 40 pixels.

startX += 40;

// Increment the loop counter.

lineCounterX += 1;

iterator += 1;

}

startX = 55;

startY += 40;

lineCounterX = 0;

lineCounterY += 1;

}

nshenry03a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 6
Where do you initialize your StringPuzzles array? By looking at your error message, you are somewhere trying to access index 19, which does not exist. Where do you calculate randomIndex?
CaptainMorgan08a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 7

code to get randomIndex:

public Random numberGenerator = new Random();

public int randomIndex = numberGenerator.nextInt( 10);

this should be right, b/c I just need a rand. number 0-9 to choose a game and that's what this code does (plus, I already commented out and set randomIndex to 6 once before to be sure this was not it and I still got the same error)

That means it probably is w/ my iterator

nshenry03a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 8

// String Arrays

public static String [][] StringPuzzles =

{

{" ", "3", "7", "2", " ", "9", " ", " ", " ", " ", "9", " ", " ", " ", " ", " ", "2", " ", " ", " ", "2", "4", "6", " ", " ", " ", " ", "2", " ", " ", " ", "1", "4", "7", " ", " ", "3", "7", " ", " ", " ", " ", "5", "8", " ", "5", "6", " ", "3", " ", " ", "1", " ", " ", "7", " ", "8", " ", " ", "6", " ", " ", " ", " ", " ", "6", " ", "3", "5", "4", " ", "8", " ", " ", "3", "7", " ", " ", " ", " ", "5"},

{" ", " ", "1", " ", "6", " ", " ", "8", " ", "5", " ", "7", "3", "8", "9", " ", "4", " ", " ", " ", " ", "1", "5", " ", "6", " ", " ", "1", "3", " ", "9", "2", "7", " ", " ", " ", "4", " ", "6", " ", " ", "8", "3", "2", " ", "8", "7", " ", " ", " ", "6", " ", " ", " ", " ", " ", " ", " ", " ", " ", "4", " ", "6", "9", " ", " ", " ", " ", " ", "2", "5", " ", " ", " ", "3", " ", "4", " ", " ", "1", " "},

{"7", " ", "1", " ", " ", " ", " ", " ", "9", " ", "6", " ", "3", " ", " ", " ", "1", " ", "2", "3", "4", " ", " ", " ", "6", " ", " ", " ", " ", " ", "7", "1", " ", " ", " ", "6", "9", "1", " ", "8", "5", " ", " ", "3", " ", " ", " ", "8", "2", " ", "4", " ", " ", " ", " ", "2", " ", " ", "7", "5", "4", " ", " ", "5", "9", " ", " ", " ", "2", " ", " ", "7", "4", " ", " ", " ", "6", " ", " ", " ", "5"},

{" ", "3", " ", " ", " ", "2", "6", " ", "7", " ", "1", " ", " ", " ", " ", "9", "8", " ", " ", " ", " ", "1", "4", " ", " ", " ", " ", " ", "6", " ", " ", " ", " ", " ", "5", " ", " ", " ", "8", " ", "1", " ", " ", " ", "9", " ", "2", " ", "5", " ", " ", "8", " ", "6", "6", "9", " ", " ", "2", " ", " ", " ", " ", "7", " ", " ", "4", " ", "6", " ", "9", "2", "4", "8", "2", " ", " ", "1", "3", " ", "5"},

{"1", " ", "8", " ", " ", " ", "4", " ", " ", " ", "2", " ", " ", "1", "8", " ", " ", " ", " ", " ", "4", "9", "2", "3", " ", " ", "6", " ", "6", " ", "7", " ", "1", " ", "9", "4", "4", "1", " ", " ", " ", "5", " ", " ", "7", " ", " ", " ", "8", " ", "6", " ", " ", "3", " ", "5", " ", " ", " ", " ", "3", " ", " ", " ", " ", " ", "5", " ", " ", " ", "7", " ", "2", " ", " ", " ", "7", "9", "5", "4", " "},

{" ", " ", " ", " ", " ", "8", "5", "2", "3", " ", "3", " ", " ", " ", " ", "6", " ", "8", " ", " ", " ", "2", "1", " ", " ", "4", " ", "1", "5", " ", "9", " ", " ", " ", "6", "2", " ", " ", "2", " ", "6", "1", " ", "3", "5", "6", "8", " ", " ", "5", " ", "4", " ", " ", " ", " ", "6", " ", "7", " ", "2", " ", " ", "8", " ", "5", " ", " ", " ", " ", " ", " ", "9", " ", "4", " ", " ", " ", "3", "8", " "},

{" ", " ", "8", " ", " ", " ", "9", " ", " ", " ", "5", "6", "1", " ", "3", "8", " ", " ", " ", "3", "7", " ", " ", "8", "5", "4", " ", " ", "2", " ", " ", "9", "6", " ", " ", "5", "5", " ", "3", " ", "7", " ", "4", " ", " ", "6", " ", " ", " ", " ", " ", "2", " ", "1", " ", "9", "4", " ", " ", " ", " ", "5", " ", " ", " ", " ", "3", " ", " ", " ", " ", " ", "7", " ", " ", " ", "1", "2", "3", "9", " "},

{" ", "9", " ", " ", "2", "1", " ", " ", " ", "8", " ", " ", "6", " ", " ", " ", " ", " ", " ", " ", " ", "9", " ", "3", "6", " ", " ", "3", "6", "7", " ", " ", " ", " ", " ", " ", "9", " ", "4", "8", " ", " ", "5", "6", " ", " ", "2", " ", " ", " ", " ", " ", "9", "1", " ", "4", " ", "7", " ", "9", " ", "5", "3", "1", " ", "3", "2", " ", "4", "9", " ", " ", " ", " ", "9", " ", " ", "8", " ", "1", "4"},

{"1", " ", "8", "6", " ", "7", "5", " ", "2", "9", "7", " ", " ", " ", "4", " ", "1", " ", "2", "3", " ", " ", " ", " ", " ", " ", "4", "6", "9", " ", " ", "3", " ", "2", " ", " ", "8", " ", " ", " ", " ", " ", "6", " ", " ", " ", " ", " ", "2", " ", " ", " ", " ", " ", "7", "2", " ", " ", " ", " ", "4", " ", "9", "5", " ", "4", " ", " ", " ", " ", "6", "1", "3", " ", " ", " ", "4", "8", " ", " ", "5"},

{" ", "9", "1", "5", " ", " ", "4", " ", " ", " ", " ", " ", "1", " ", " ", "3", "7", " ", " ", " ", " ", " ", " ", " ", " ", "1", " ", "3", "4", " ", "7", "1", " ", "5", " ", " ", "1", " ", " ", "4", " ", " ", " ", " ", "3", " ", " ", "2", " ", "3", " ", "8", "4", " ", " ", " ", "7", " ", "2", " ", "6", "8", " ", " ", " ", " ", " ", " ", "6", "2", "5", "9", "8", " ", " ", " ", "4", " ", " ", " ", " "}

};

nshenry03a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 9
> That means it probably is w/ my iteratorI don't think it is, judging from the code you posted. Try just posting your entire class.
CaptainMorgan08a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 10

import java.awt.*;

import javax.swing.*;

import java.util.Random;

/**

* Graphical Sudoku Board Game

*

* File: Sudoku.java

* @version Saturday, January 27, 2007

* @author Nicholas Henry

*/

public class SudokuApp extends JFrame

{

private static final long serialVersionUID = -7122703673491967341;

private static final intAPP_WIDTH= 700;

private static final intAPP_HEIGHT = 600;

// Class Methods and Variables //////////////////////////////////

// Variables.

// public static SudokuAppapp;

public Random numberGenerator = new Random();

public int randomIndex = numberGenerator.nextInt( 10);

// String Arrays

public static String [][] StringPuzzles =

{

{" ", "3", "7", "2", " ", "9", " ", " ", " ", " ", "9", " ", " ", " ", " ", " ", "2", " ", " ", " ", "2", "4", "6", " ", " ", " ", " ", "2", " ", " ", " ", "1", "4", "7", " ", " ", "3", "7", " ", " ", " ", " ", "5", "8", " ", "5", "6", " ", "3", " ", " ", "1", " ", " ", "7", " ", "8", " ", " ", "6", " ", " ", " ", " ", " ", "6", " ", "3", "5", "4", " ", "8", " ", " ", "3", "7", " ", " ", " ", " ", "5"},

{" ", " ", "1", " ", "6", " ", " ", "8", " ", "5", " ", "7", "3", "8", "9", " ", "4", " ", " ", " ", " ", "1", "5", " ", "6", " ", " ", "1", "3", " ", "9", "2", "7", " ", " ", " ", "4", " ", "6", " ", " ", "8", "3", "2", " ", "8", "7", " ", " ", " ", "6", " ", " ", " ", " ", " ", " ", " ", " ", " ", "4", " ", "6", "9", " ", " ", " ", " ", " ", "2", "5", " ", " ", " ", "3", " ", "4", " ", " ", "1", " "},

{"7", " ", "1", " ", " ", " ", " ", " ", "9", " ", "6", " ", "3", " ", " ", " ", "1", " ", "2", "3", "4", " ", " ", " ", "6", " ", " ", " ", " ", " ", "7", "1", " ", " ", " ", "6", "9", "1", " ", "8", "5", " ", " ", "3", " ", " ", " ", "8", "2", " ", "4", " ", " ", " ", " ", "2", " ", " ", "7", "5", "4", " ", " ", "5", "9", " ", " ", " ", "2", " ", " ", "7", "4", " ", " ", " ", "6", " ", " ", " ", "5"},

{" ", "3", " ", " ", " ", "2", "6", " ", "7", " ", "1", " ", " ", " ", " ", "9", "8", " ", " ", " ", " ", "1", "4", " ", " ", " ", " ", " ", "6", " ", " ", " ", " ", " ", "5", " ", " ", " ", "8", " ", "1", " ", " ", " ", "9", " ", "2", " ", "5", " ", " ", "8", " ", "6", "6", "9", " ", " ", "2", " ", " ", " ", " ", "7", " ", " ", "4", " ", "6", " ", "9", "2", "4", "8", "2", " ", " ", "1", "3", " ", "5"},

{"1", " ", "8", " ", " ", " ", "4", " ", " ", " ", "2", " ", " ", "1", "8", " ", " ", " ", " ", " ", "4", "9", "2", "3", " ", " ", "6", " ", "6", " ", "7", " ", "1", " ", "9", "4", "4", "1", " ", " ", " ", "5", " ", " ", "7", " ", " ", " ", "8", " ", "6", " ", " ", "3", " ", "5", " ", " ", " ", " ", "3", " ", " ", " ", " ", " ", "5", " ", " ", " ", "7", " ", "2", " ", " ", " ", "7", "9", "5", "4", " "},

{" ", " ", " ", " ", " ", "8", "5", "2", "3", " ", "3", " ", " ", " ", " ", "6", " ", "8", " ", " ", " ", "2", "1", " ", " ", "4", " ", "1", "5", " ", "9", " ", " ", " ", "6", "2", " ", " ", "2", " ", "6", "1", " ", "3", "5", "6", "8", " ", " ", "5", " ", "4", " ", " ", " ", " ", "6", " ", "7", " ", "2", " ", " ", "8", " ", "5", " ", " ", " ", " ", " ", " ", "9", " ", "4", " ", " ", " ", "3", "8", " "},

{" ", " ", "8", " ", " ", " ", "9", " ", " ", " ", "5", "6", "1", " ", "3", "8", " ", " ", " ", "3", "7", " ", " ", "8", "5", "4", " ", " ", "2", " ", " ", "9", "6", " ", " ", "5", "5", " ", "3", " ", "7", " ", "4", " ", " ", "6", " ", " ", " ", " ", " ", "2", " ", "1", " ", "9", "4", " ", " ", " ", " ", "5", " ", " ", " ", " ", "3", " ", " ", " ", " ", " ", "7", " ", " ", " ", "1", "2", "3", "9", " "},

{" ", "9", " ", " ", "2", "1", " ", " ", " ", "8", " ", " ", "6", " ", " ", " ", " ", " ", " ", " ", " ", "9", " ", "3", "6", " ", " ", "3", "6", "7", " ", " ", " ", " ", " ", " ", "9", " ", "4", "8", " ", " ", "5", "6", " ", " ", "2", " ", " ", " ", " ", " ", "9", "1", " ", "4", " ", "7", " ", "9", " ", "5", "3", "1", " ", "3", "2", " ", "4", "9", " ", " ", " ", " ", "9", " ", " ", "8", " ", "1", "4"},

{"1", " ", "8", "6", " ", "7", "5", " ", "2", "9", "7", " ", " ", " ", "4", " ", "1", " ", "2", "3", " ", " ", " ", " ", " ", " ", "4", "6", "9", " ", " ", "3", " ", "2", " ", " ", "8", " ", " ", " ", " ", " ", "6", " ", " ", " ", " ", " ", "2", " ", " ", " ", " ", " ", "7", "2", " ", " ", " ", " ", "4", " ", "9", "5", " ", "4", " ", " ", " ", " ", "6", "1", "3", " ", " ", " ", "4", "8", " ", " ", "5"},

{" ", "9", "1", "5", " ", " ", "4", " ", " ", " ", " ", " ", "1", " ", " ", "3", "7", " ", " ", " ", " ", " ", " ", " ", " ", "1", " ", "3", "4", " ", "7", "1", " ", "5", " ", " ", "1", " ", " ", "4", " ", " ", " ", " ", "3", " ", " ", "2", " ", "3", " ", "8", "4", " ", " ", " ", "7", " ", "2", " ", "6", "8", " ", " ", " ", " ", " ", " ", "6", "2", "5", "9", "8", " ", " ", " ", "4", " ", " ", " ", " "}

};

public static String [][] StringSolns =

{

{"6", "3", "7", "2", "5", "9", "8", "4", "1", "4", "9", "5", "8", "7", "1", "3", "2", "6", "8", "1", "2", "4", "6", "3", "9", "5", "7", "2", "8", "9", "5", "1", "4", "7", "6", "3", "3", "7", "1", "6", "9", "2", "5", "8", "4", "5", "6", "4", "3", "8", "7", "1", "9", "2", "7", "5", "8", "1", "4", "6", "2", "3", "9", "1", "2", "6", "9", "3", "5", "4", "7", "8", "9", "4", "3", "7", "2", "8", "6", "1", "5"},

{"3", "4", "1", "7", "6", "2", "9", "8", "5", "5", "6", "7", "3", "8", "9", "1", "4", "2", "2", "8", "9", "1", "5", "4", "6", "7", "3", "1", "3", "5", "9", "2", "7", "8", "6", "4", "4", "9", "6", "5", "1", "8", "3", "2", "7", "8", "7", "2", "4", "3", "6", "5", "9", "1", "7", "5", "8", "2", "9", "1", "4", "3", "6", "9", "1", "4", "6", "7", "3", "2", "5", "8", "6", "2", "3", "8", "4", "5", "7", "1", "9"},

{"7", "5", "1", "6", "2", "8", "3", "4", "9", "8", "6", "9", "3", "4", "7", "5", "1", "2", "2", "3", "4", "5", "9", "1", "6", "7", "8", "3", "4", "5", "7", "1", "9", "8", "2", "6", "9", "1", "2", "8", "5", "6", "7", "3", "4", "6", "7", "8", "2", "3", "4", "9", "5", "1", "1", "2", "6", "9", "7", "5", "4", "8", "3", "5", "9", "3", "4", "8", "2", "1", "6", "7", "4", "8", "7", "1", "6", "3", "2", "9", "5"},

{"9", "3", "4", "8", "5", "2", "6", "1", "7", "2", "1", "5", "7", "6", "3", "9", "8", "4", "8", "7", "6", "1", "4", "9", "5", "2", "3", "3", "6", "7", "2", "9", "8", "4", "5", "1", "5", "4", "8", "6", "1", "7", "2", "3", "9", "1", "2", "9", "5", "3", "4", "8", "7", "6", "6", "9", "1", "3", "2", "5", "7", "4", "8", "7", "5", "3", "4", "8", "6", "1", "9", "2", "4", "8", "2", "9", "7", "1", "3", "6", "5"},

{"1", "3", "8", "6", "5", "7", "4", "2", "9", "6", "2", "9", "4", "1", "8", "7", "3", "5", "5", "7", "4", "9", "2", "3", "8", "1", "6", "8", "6", "5", "7", "3", "1", "2", "9", "4", "4", "1", "3", "2", "9", "5", "6", "8", "7", "7", "9", "2", "8", "4", "6", "1", "5", "3", "9", "5", "7", "1", "8", "4", "3", "6", "2", "3", "4", "1", "5", "6", "2", "9", "7", "8", "2", "8", "6", "3", "7", "9", "5", "4", "1"},

{"7", "4", "1", "6", "9", "8", "5", "2", "3", "2", "3", "9", "5", "4", "7", "6", "1", "8", "5", "6", "8", "2", "1", "3", "9", "4", "7", "1", "5", "3", "9", "8", "4", "7", "6", "2", "4", "9", "2", "7", "6", "1", "8", "3", "5", "6", "8", "7", "3", "5", "2", "4", "9", "1", "3", "1", "6", "8", "7", "9", "2", "5", "4", "8", "2", "5", "4", "3", "6", "1", "7", "9", "9", "7", "4", "1", "2", "5", "3", "8", "6"},

{"2", "4", "8", "7", "6", "5", "9", "1", "3", "9", "5", "6", "1", "4", "3", "8", "2", "7", "1", "3", "7", "9", "2", "8", "5", "4", "6", "4", "2", "1", "8", "9", "6", "7", "3", "5", "5", "8", "3", "2", "7", "1", "4", "6", "9", "6", "7", "9", "5", "3", "4", "2", "8", "1", "3", "9", "4", "6", "8", "7", "1", "5", "2", "8", "1", "2", "3", "5", "9", "6", "7", "4", "7", "6", "5", "4", "1", "2", "3", "9", "8"},

{"4", "9", "6", "5", "2", "1", "7", "3", "8", "8", "3", "5", "6", "4", "7", "1", "2", "9", "2", "7", "1", "9", "8", "3", "6", "4", "5", "3", "6", "7", "1", "9", "5", "4", "8", "2", "9", "1", "4", "8", "3", "2", "5", "6", "7", "5", "2", "8", "4", "7", "6", "3", "9", "1", "6", "4", "2", "7", "1", "9", "8", "5", "3", "1", "8", "3", "2", "5", "4", "9", "7", "6", "7", "5", "9", "3", "6", "8", "2", "1", "4"},

{"1", "4", "8", "6", "9", "7", "5", "3", "2", "9", "7", "5", "3", "2", "4", "8", "1", "6", "2", "3", "6", "8", "1", "5", "9", "7", "4", "6", "9", "7", "4", "3", "1", "2", "5", "8", "8", "1", "2", "7", "5", "9", "6", "4", "3", "4", "5", "3", "2", "8", "6", "1", "9", "7", "7", "2", "1", "5", "6", "3", "4", "8", "9", "5", "8", "4", "9", "7", "2", "3", "6", "1", "3", "6", "9", "1", "4", "8", "7", "2", "5"},

{"7", "9", "1", "5", "6", "3", "4", "2", "8", "2", "8", "5", "1", "9", "4", "3", "7", "6", "6", "3", "4", "2", "8", "7", "9", "1", "5", "3", "4", "9", "7", "1", "8", "5", "6", "2", "1", "6", "8", "4", "5", "2", "7", "9", "3", "5", "7", "2", "6", "3", "9", "8", "4", "1", "9", "5", "7", "3", "2", "1", "6", "8", "4", "4", "1", "3", "8", "7", "6", "2", "5", "9", "8", "2", "6", "9", "4", "5", "1", "3", "7"}

};

// Int Arrays

public static int [][] puzzles =

{

{0, 3, 7, 2, 0, 9, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 4, 6, 0, 0, 0, 0, 2, 0, 0, 0, 1, 4, 7, 0, 0, 3, 7, 0, 0, 0, 0, 5, 8, 0, 5, 6, 0, 3, 0, 0, 1, 0, 0, 7, 0, 8, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 3, 5, 4, 0, 8, 0, 0, 3, 7, 0, 0, 0, 0, 5},

{0, 0, 1, 0, 6, 0, 0, 8, 0, 5, 0, 7, 3, 8, 9, 0, 4, 0, 0, 0, 0, 1, 5, 0, 6, 0, 0, 1, 3, 0, 9, 2, 7, 0, 0, 0, 4, 0, 6, 0, 0, 8, 3, 2, 0, 8, 7, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 9, 0, 0, 0, 0, 0, 2, 5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, 8, 6, 1, 9, 7, 7, 2, 1, 5, 6, 3, 4, 8, 9, 5, 8, 4, 9, 7, 2, 3, 6, 1, 3, 6, 9, 1, 4, 8, 7, 2, 5},

{7, 9, 1, 5, 6, 3, 4, 2, 8, 2, 8, 5, 1, 9, 4, 3, 7, 6, 6, 3, 4, 2, 8, 7, 9, 1, 5, 3, 4, 9, 7, 1, 8, 5, 6, 2, 1, 6, 8, 4, 5, 2, 7, 9, 3, 5, 7, 2, 6, 3, 9, 8, 4, 1, 9, 5, 7, 3, 2, 1, 6, 8, 4, 4, 1, 3, 8, 7, 6, 2, 5, 9, 8, 2, 6, 9, 4, 5, 1, 3, 7}

};

// Get a random number to choose one of 60 games

Random generator = new Random();

public int fileNumUsed = generator.nextInt(59);

// Get Game

int [] intGameArray = puzzles[fileNumUsed];

String [] strGameArray = StringPuzzles[fileNumUsed];

// Get answers to game

int [] intSolnArray = solns[fileNumUsed];

String[] strSolnArray = StringSolns[fileNumUsed];

// Instance Methods and Variables ///////////////////////////////

// Public Methods ///////////////////////////////////////////////

/** Creates a new instance of the simple stand-alone application. */

public static void main(String[] args) {

new SudokuApp();

}

public SudokuApp() {

super();

this.initComponents();

}

// Private Methods //////////////////////////////////////////////

/** Initialize the GUI components. */

private void initComponents() {

this.setSize(APP_WIDTH, APP_HEIGHT);

this.show();

//this.setTitle("Sudoku!");

}

/** Draw the JFrame.

* @param gfx the Graphics object to which we'll draw.

*/

public void paint(Graphics gfx) {

super.paint(gfx);

// Draw the Board

this.drawBoard();

}

public void drawBoard()

{

Container workArea = this.getContentPane();

Graphics workAreaGfx = workArea.getGraphics();

// draw white background

workAreaGfx.setColor(Color.white);

int bgwidth = workArea.getWidth();

int bgheight = workArea.getHeight();

workAreaGfx.fillRect(0, 0, bgwidth, bgheight);

// Code to draw the thin grid lines.

// First, set the line color.

workAreaGfx.setColor(Color.blue);

// Draw the vertical grid lines.

// Set initial loop conditions.

int lineCounter = 0;

int startX = 40;

int startY = 160;

// Use a loop to draw the lines.

while (lineCounter < 10) {

// Draw the line.

workAreaGfx.drawLine(startX, startY, startX, startY + 360);

// Move over 40 pixels.

startX += 40;

// Increment the loop counter.

lineCounter += 1;

}

// Draw the horizontal grid lines.

// Reset initial loop conditions.

lineCounter = 0;

startX = 40;

startY = 160;

// Use a loop to draw the lines.

while (lineCounter < 10) {

// Draw the line.

workAreaGfx.drawLine(startX, startY, startX + 360, startY);

// Move down 40 pixels.

startY += 40;

// Increment the loop counter.

lineCounter += 1;

}

// Code to draw the thick grid lines.

Graphics2D g2 = (Graphics2D)workAreaGfx;

g2.setStroke(new BasicStroke(3));

// Draw the vertical grid lines.

// Set initial loop conditions.

lineCounter = 0;

startX = 40;

startY = 160;

// Use a loop to draw the lines.

while (lineCounter < 4) {

// Draw the line.

g2.drawLine(startX, startY, startX, startY + 360);

// Move over 20 pixels.

startX += 120;

// Increment the loop counter.

lineCounter += 1;

}

// Draw the horizontal grid lines.

// Reset initial loop conditions.

lineCounter = 0;

startX = 40;

startY = 160;

// Use a loop to draw the lines.

while (lineCounter < 4) {

// Draw the line.

g2.drawLine(startX, startY, startX + 360, startY);

// Move down 40 pixels.

startY += 120;

// Increment the loop counter.

lineCounter += 1;

}

// Code to draw the Title Text

workAreaGfx.setColor(Color.black);

Font titleFont = new Font("Verdana", Font.BOLD, 36);

workAreaGfx.setFont(titleFont);

workAreaGfx.drawString("Sudoku", 40, 40);

// Code to draw rules

Font rulesFont = new Font("Arial", Font.PLAIN, 14);

workAreaGfx.setFont(rulesFont);

workAreaGfx.drawString("The objective of the game is to fill all the blank squares in a game with the correct numbers.", 40, 60);

workAreaGfx.drawString("There are three very simple constraints to follow. In a 9 by 9 square Sudoku game:", 40, 80);

Font bulletsFont = new Font("Arial", Font.ITALIC, 14);

workAreaGfx.setFont(bulletsFont);

workAreaGfx.drawString("1. Every row of 9 numbers must include all digits 1 through 9 in any order", 40, 100);

workAreaGfx.drawString("2. Every column of 9 numbers must include all digits 1 through 9 in any order", 40, 120);

workAreaGfx.drawString("3. Every 3 by 3 subsection of the 9 by 9 square must include all digits 1 through 9", 40, 140);

workAreaGfx.setFont(rulesFont);

// Draw the given numbers.

// Set initial loop conditions.

int lineCounterX = 0;

int lineCounterY = 0;

int iterator = 0;

startX = 55;

startY = 185;

// Use a loop to draw the numbers.

while (lineCounterY < 9) {

while (lineCounterX < 9) {

// Draw the number.

workAreaGfx.drawString(StringPuzzles[randomIndex][iterator], startX, startY);

// Move over 40 pixels.

startX += 40;

// Increment the loop counter.

lineCounterX += 1;

iterator += 1;

}

startX = 55;

startY += 40;

lineCounterX = 0;

lineCounterY += 1;

}

}

}

nshenry03a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 11

// Get a random number to choose one of 60 games

Random generator = new Random();

public int fileNumUsed = generator.nextInt(59);

// Get Game

int [] intGameArray = puzzles[fileNumUsed];

String [] strGameArray = StringPuzzles[fileNumUsed];

// Get answers to game

int [] intSolnArray = solns[fileNumUsed];

String[] strSolnArray = StringSolns[fileNumUsed];

The error is here. You generate a number between 0-58, then try to access that index of array in puzzles, which only goes from 0-9. Does that make sense?

CaptainMorgan08a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 12
yes, this makes perfect sense, thank you... However; Anybody know how to unhide lines in Eclipse 3.2? It's got to be in those missing lines 87-1? b/c I can't see this part of the code (I thought I must have deleted it, thus the other Rand. Generator) and I can't fine it w/
nshenry03a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 13
> b/c I can't see this part of the code Then how did you post it? ;-)
CaptainMorgan08a at 2007-7-8 22:54:22 > top of Java-index,Java Essentials,New To Java...
# 14

This code is cr@p, but I did fix it. It compiles and runs now.

%

PS - One bit of advice: "Magic numbers" are very, very bad. Google for the term, learn what it is, and stop doing it.

package cruft;

import javax.swing.JFrame;

import java.awt.BasicStroke;

import java.awt.Color;

import java.awt.Container;

import java.awt.Font;

import java.awt.Graphics;

import java.awt.Graphics2D;

import java.util.Random;

/**

* Graphical Sudoku Board Game

*

* File: Sudoku.java

* @version Saturday, January 27, 2007

* @author Nicholas Henry

*/

public class Sudoku extends JFrame

{

private static final intAPP_WIDTH= 700;

private static final intAPP_HEIGHT = 600;

public Random numberGenerator = new Random();

public int randomIndex = numberGenerator.nextInt( 10);

// String Arrays

public static String [][] StringPuzzles =

{

{" ", "3", "7", "2", " ", "9", " ", " ", " ", " ", "9", " ", " ", " ", " ", " ", "2", " ", " ", " ", "2", "4", "6", " ", " ", " ", " ", "2", " ", " ", " ", "1", "4", "7", " ", " ", "3", "7", " ", " ", " ", " ", "5", "8", " ", "5", "6", " ", "3", " ", " ", "1", " ", " ", "7", " ", "8", " ", " ", "6", " ", " ", " ", " ", " ", "6", " ", "3", "5", "4", " ", "8", " ", " ", "3", "7", " ", " ", " ", " ", "5"},

{" ", " ", "1", " ", "6", " ", " ", "8", " ", "5", " ", "7", "3", "8", "9", " ", "4", " ", " ", " ", " ", "1", "5", " ", "6", " ", " ", "1", "3", " ", "9", "2", "7", " ", " ", " ", "4", " ", "6", " ", " ", "8", "3", "2", " ", "8", "7", " ", " ", " ", "6", " ", " ", " ", " ", " ", " ", " ", " ", " ", "4", " ", "6", "9", " ", " ", " ", " ", " ", "2", "5", " ", " ", " ", "3", " ", "4", " ", " ", "1", " "},

{"7", " ", "1", " ", " ", " ", " ", " ", "9", " ", "6", " ", "3", " ", " ", " ", "1", " ", "2", "3", "4", " ", " ", " ", "6", " ", " ", " ", " ", " ", "7", "1", " ", " ", " ", "6", "9", "1", " ", "8", "5", " ", " ", "3", " ", " ", " ", "8", "2", " ", "4", " ", " ", " ", " ", "2", " ", " ", "7", "5", "4", " ", " ", "5", "9", " ", " ", " ", "2", " ", " ", "7", "4", " ", " ", " ", "6", " ", " ", " ", "5"},

{" ", "3", " ", " ", " ", "2", "6", " ", "7", " ", "1", " ", " ", " ", " ", "9", "8", " ", " ", " ", " ", "1", "4", " ", " ", " ", " ", " ", "6", " ", " ", " ", " ", " ", "5", " ", " ", " ", "8", " ", "1", " ", " ", " ", "9", " ", "2", " ", "5", " ", " ", "8", " ", "6", "6", "9", " ", " ", "2", " ", " ", " ", " ", "7", " ", " ", "4", " ", "6", " ", "9", "2", "4", "8", "2", " ", " ", "1", "3", " ", "5"},

{"1", " ", "8", " ", " ", " ", "4", " ", " ", " ", "2", " ", " ", "1", "8", " ", " ", " ", " ", " ", "4", "9", "2", "3", " ", " ", "6", " ", "6", " ", "7", " ", "1", " ", "9", "4", "4", "1", " ", " ", " ", "5", " ", " ", "7", " ", " ", " ", "8", " ", "6", " ", " ", "3", " ", "5", " ", " ", " ", " ", "3", " ", " ", " ", " ", " ", "5", " ", " ", " ", "7", " ", "2", " ", " ", " ", "7", "9", "5", "4", " "},

{" ", " ", " ", " ", " ", "8", "5", "2", "3", " ", "3", " ", " ", " ", " ", "6", " ", "8", " ", " ", " ", "2", "1", " ", " ", "4", " ", "1", "5", " ", "9", " ", " ", " ", "6", "2", " ", " ", "2", " ", "6", "1", " ", "3", "5", "6", "8", " ", " ", "5", " ", "4", " ", " ", " ", " ", "6", " ", "7", " ", "2", " ", " ", "8", " ", "5", " ", " ", " ", " ", " ", " ", "9", " ", "4", " ", " ", " ", "3", "8", " "},

{" ", " ", "8", " ", " ", " ", "9", " ", " ", " ", "5", "6", "1", " ", "3", "8", " ", " ", " ", "3", "7", " ", " ", "8", "5", "4", " ", " ", "2", " ", " ", "9", "6", " ", " ", "5", "5", " ", "3", " ", "7", " ", "4", " ", " ", "6", " ", " ", " ", " ", " ", "2", " ", "1", " ", "9", "4", " ", " ", " ", " ", "5", " ", " ", " ", " ", "3", " ", " ", " ", " ", " ", "7", " ", " ", " ", "1", "2", "3", "9", " "},

{" ", "9", " ", " ", "2", "1", " ", " ", " ", "8", " ", " ", "6", " ", " ", " ", " ", " ", " ", " ", " ", "9", " ", "3", "6", "