The Linuxator
Banned
Updated Code !
To make things simple
- I am constructing a Sudoku puzzle.
- After thinking about it , I made 9 arrays (containg 9 elements each) representing 9 rows.
- the columns of the Sudoku puzzle are represented by the order of the number in an array.
- The reason for the use of rows and coulmns is because I need to read the values in from a text file ( SudokuNmbr.txt) . each line contains something like this 0 1 1 ( these number indicate the column 0 , row 1 has a number 1 in it)
I don't have the option of how to format the text file so this is how I am working with things.
- the format of the info in the text file is as follows in my attahced code.
and the Sudoku 9x9 grid will look as follows for this example pic
What is missing for me :
1- The way I wrote the loop in the populateRows method it only reads the 1st line in the text file and fills in the 3 values only, I want something that instead goes through the whole text file and stops once it reaches the -1 -1 -1 at the end. So that way I can fill the entire Sudoku grid in one loop 😉
2- In my editSudoku method I am stuck at the end, what I want to do is :
- clmn (in the editSudoku method) can't be used in the Long (because it;s going to be used to denote the array element number) so I have to convert it into an Int how do I do that ?
Pretty much after I fix those two issues, all I will have to do is add a method that will look throught the textfile for a match to what the user is trying to edit and if it returns false I will go ahead and let the user change the value.
This is due very soon and your help will not be forgotten.
To make things simple
- I am constructing a Sudoku puzzle.
- After thinking about it , I made 9 arrays (containg 9 elements each) representing 9 rows.
- the columns of the Sudoku puzzle are represented by the order of the number in an array.
- The reason for the use of rows and coulmns is because I need to read the values in from a text file ( SudokuNmbr.txt) . each line contains something like this 0 1 1 ( these number indicate the column 0 , row 1 has a number 1 in it)
I don't have the option of how to format the text file so this is how I am working with things.
- the format of the info in the text file is as follows in my attahced code.
and the Sudoku 9x9 grid will look as follows for this example pic
What is missing for me :
1- The way I wrote the loop in the populateRows method it only reads the 1st line in the text file and fills in the 3 values only, I want something that instead goes through the whole text file and stops once it reaches the -1 -1 -1 at the end. So that way I can fill the entire Sudoku grid in one loop 😉
2- In my editSudoku method I am stuck at the end, what I want to do is :
- clmn (in the editSudoku method) can't be used in the Long (because it;s going to be used to denote the array element number) so I have to convert it into an Int how do I do that ?
Pretty much after I fix those two issues, all I will have to do is add a method that will look throught the textfile for a match to what the user is trying to edit and if it returns false I will go ahead and let the user change the value.
This is due very soon and your help will not be forgotten.