View Single Post
Old 10-28-2005, 05:54 AM   #1 (permalink)
sugarless
Registered User
 
Join Date: Oct 2005
Posts: 3
sugarless is on a distinguished road
Thumbs up Sudoku checker (Array Help)

lately, care of my dad, i've been addicted to those sudoku puzzle's especially the super size ones.. i completed a C and a java course last year, so i figured hey i'm sure i can code something to help me with these puzzles! wrong...

i know there are simple to advanced little progs for this everywhere, but its an ego thing now.. basically i tackled the problem one way and got completely lost and wanted to jump out the window.. i want to start simple because i've forgotten a lot, especially file i/o..

aim:

basically i want to write a little console prog that will read a file eg. something called sudoku.in, where i can punch in the numbers (9rows, 9columns), either partially finished with 0's for spaces, or completed and either check if its valid, or return co-ordinates where its incorrect..

eg.

060104050
008305600
200000001
800406006
006000300
700901004
500000002
007206900
040508070

i figure i read the input of this file, into a 2dimensional array, and then check for duplicated numbers in rows or colums (ignoring 0's for spaces).. however, i completely forget 2d arrays and its driving me bonkers, because it seems embarassingly easy..

can anybody point me in the right direction.. or some useful code for file io, because the text book i have is completely useless, and the given example with the code gave me a compile error.....
sugarless is offline   Reply With Quote