Forums Register Login

sudoku

+Pie Number of slices to send: Send
i am new to java so "forgive" my level of understanding. i need help in writing a program to read a sudoku puzzle from a file.the file should contain 9 lines of text, each line being nine characters long. the digits 1 to 9 will be in their correct positions and unknown positions/cells will be represented by the digit 0. once loaded the program should display the grid followed by a blank line.
I would greatly appreciate a prompt response as i nedd asap.
thx
+Pie Number of slices to send: Send
A good place to start would be a tutorial on I/O: http://java.sun.com/docs/books/tutorial/essential/io/index.html
+Pie Number of slices to send: Send
If you're looking to just display it and check the results then you could create a list of arrays which are 9 'ints' long or better yet, an array of arrays so you could refer to each input with a getBlock[x][y] method. Treat each one like a coordinate on a map. Then you could create several loops to determine the validity of the numbers. I've been thinking about taking a stab at a sudoku solver using this technique.
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 683 times.
Similar Threads
i want to design sudukopuzzle in java .what i need to do?
SoDuko puzzle
Exception -- java.lang.StackOverflowError
Serialization??
game
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:01:52.