Results 1 to 2 of 2
Thread: Update New to Java
- 04-08-2010, 12:12 AM #1Member
- Join Date
- Apr 2010
- Rep Power
Update New to Java
Okay last time I posted I copied and pasted my code and it ended up being because I had a false statement in it.
This is for a Soduku randomizer. I have been trying to figure out what or how to put in the right syntax to make my current soduku puzzle be a vaild soduku puzzle.
the fallowing is code and if there is any way to make it easier for you to read please let me know.
private void initGame()
Random r = new Random( 9 );
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++)
int randomValue = r.nextInt( 9 ) + 1;
if (IsValid( i, j, randomValue ))
cells[i][j].setText( String.valueOf( randomValue ) );
private boolean IsValid( int row, int column, int value )
System.out.println( "Checking " + row + " " + column + " for " + value );
Also could anybody refer me to good books that will help me understand Java better with being a newbie I love learning the language just would like to get to know java like it was a second language.
Thanks again everyone.:)
- By twinks in forum Advanced JavaReplies: 0Last Post: 10-07-2009, 02:13 PM
- By bizadi in forum New To JavaReplies: 12Last Post: 04-03-2009, 04:39 PM
- By guest in forum New To JavaReplies: 1Last Post: 12-01-2007, 05:36 AM
- By patricknowow in forum New To JavaReplies: 1Last Post: 11-30-2007, 04:57 AM
- By derrickD in forum Java SoftwareReplies: 1Last Post: 05-06-2007, 06:46 AM