alright, if you've heard of my sudoku project, then you'll know what i mean. i might post the algorithm here if i get enough votes so, anyway would you like me to post it? it will be long, hard work explaining the whole thing, but i think i could do it.
Offline
Hello???
Offline
a mathematical equation,in this case one that solves a sudoku puzzle.
Offline
I'd like to see it! I wrote one in Excel VB a while back...but it was easier there because I had arrays. Doing it in Scratch would be a real challenge.
Offline
bigB wrote:
i think it would be facinating
thanks!
Offline
Jens wrote:
Sure, AlanProjects! I'm interested in how you plan to tackle this...
Alright, I'll start posting soon, it will be a LOOOOOOOOOOOOOOOOONG post. Maybe I'll split it up into several posts, who knows?
Offline
Paddle2See wrote:
I'd like to see it! I wrote one in Excel VB a while back...but it was easier there because I had arrays. Doing it in Scratch would be a real challenge.
I am planning on doing it if 1.3 if it has arrays. From what I've seen(1.3 rc), it will. The algorithm involves sets, so arrays actually make it possible.
Offline
Alright, I will start:
First you need to think of your sudoku like this(it helps if you actually write this.):
a b c d e f g h i
(think of the letters above it as part of the image(i didn't put them in ) )
The uppercase letters denote 3x3 boxes, lowercase letters denote columns, and numbers denote rows.
Now, treat each one as an array. That makes 27 arrays. Now we convert what's on the grid to the array. By default(lol, i mean if a row/column/3x3 box is blank) the array has every number in soduku(1-9). NOTE: in mathematics, what i am calling an array is called a set. if i say set, then you know what i mean. Anyway, if a row/column/3x3 box has a number in it(or numbers) you get rid of them from the array. example:
alright this is how i would arrange it on paper:
1:
2:
3:
4:
5:
6:
7:
8:
9:
a:
b:
c:
d:
e:
f:
g:
h:
i:
A:
B:
C:
D:
E:
F:
G:
H:
I:
now we start filling this out...... Look in next post( my fingers are sore )
Last edited by AlanProjects (2008-08-23 19:58:14)
Offline
Alright, I'm continuing:
1:,4,5,7,9
2:1,3,5,6,7,8
3:1,2,6,7,9
4:1,2,3,5,8,9
5:1,2,4,6,7,8,9
6:4,5,6,9
7:2,3,4,5,8
8:1,4,5,6,7,9
9:1,6,7,8
a:1,2,4,9
b:1,4,5,6,7,9
c:5,6,7,8,9
d:2,3,4,5
e:1,2,5,6,7,8,9
f:1,2,6,9
g:3,5,6,7,8
h:1,3,4,6,7,8
i:1,4,7,8
A:1,4,5,7,9
B:2,3,6,7,8
C:1,2,6,8,9
D:1,2,4,5,9
E:1,2,4,5,9
F:3,4,6,7,8
G:4,5,6,7,9
H:1,2,5,6,8
I:1,3,4,7,8
So now you see that these sets represent the number(s) that could fit into that row/column/3x3 box.
Last edited by AlanProjects (2008-08-23 20:29:02)
Offline
Yay! i finished that. Sorry, i'll continue after i eat and my fingers aren't on fire
Offline
dingdong wrote:
uh... yeah, I'm good at sudoku, but I don't what to say about this, .............................................. WHHHHHHAAAAATTTTTTTTTT!!?!?!?!?!?!?!?
lol! i'm not done yet.
Offline
I think this topic probably belongs better in Advanced Topics so I'm moving it.
Offline
Paddle2See wrote:
I think this topic probably belongs better in Advanced Topics so I'm moving it.
alright, whatever. i think i'll continue posting tommorow.
Offline
I usually just look about 3 steps ahead. The first time I tried Sudoku, I tried the hardest puzzle on the page and aced it
Offline
Cont.:
So now can ya think what you do next? HINT:think of a normal way to solve a soduku. Now think of how you eliminate numbers from what you know could be in a row/column/3x3 box because they are already in the same row/column/3x3 box.
Offline
The algorithm I've used in my sudoku Java solver: It starts with a "logical" solving - it controls rows, columns, squares, etc. After all the possibilities are spent, the second section comes up - backtracking
http://sudoku.ulesa.cz
Offline