This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-08-21 21:56:10

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

The sudoku algorithm.(solving)

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

 

#2 2008-08-21 22:00:09

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

Hello???

Offline

 

#3 2008-08-21 22:03:58

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: The sudoku algorithm.(solving)

hello.ive played sudoku.im pretty good at it.I dont know what algorithm is

Offline

 

#4 2008-08-21 22:07:48

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

a mathematical equation,in this case one that solves a sudoku puzzle.

Offline

 

#5 2008-08-21 22:09:09

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: The sudoku algorithm.(solving)

Is it a project if not nope,dont care.If so sure post it.

Offline

 

#6 2008-08-22 01:50:45

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: The sudoku algorithm.(solving)

Sure, AlanProjects! I'm interested in how you plan to tackle this...


Jens Mönig

Offline

 

#7 2008-08-22 05:51:57

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: The sudoku algorithm.(solving)

i think it would be facinating


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#8 2008-08-22 07:12:59

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: The sudoku algorithm.(solving)

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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#9 2008-08-23 19:20:09

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

bigB wrote:

i think it would be facinating

thanks!

Offline

 

#10 2008-08-23 19:22:12

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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

 

#11 2008-08-23 19:24:17

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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

 

#12 2008-08-23 19:39:23

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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
http://lh3.ggpht.com/alanm12345/SLCexywDmSI/AAAAAAAAACM/CkgQkdZ7MwQ/grid.jpg
(think of the letters above it as part of the image(i didn't put them in  sad  ) )
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:
http://z.about.com/d/puzzles/1/0/Q/f/sudokuxe01.gif
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  big_smile  )

Last edited by AlanProjects (2008-08-23 19:58:14)

Offline

 

#13 2008-08-23 20:05:36

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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

 

#14 2008-08-23 20:30:09

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

Yay! i finished that. Sorry, i'll continue after i eat and my fingers aren't on fire  big_smile

Offline

 

#15 2008-08-23 20:32:21

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: The sudoku algorithm.(solving)

uh... yeah, I'm good at sudoku, but I don't what to say about this, .............................................. WHHHHHHAAAAATTTTTTTTTT!!?!?!?!?!?!?!?


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#16 2008-08-23 20:33:03

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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

 

#17 2008-08-23 22:10:26

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: The sudoku algorithm.(solving)

I think this topic probably belongs better in Advanced Topics so I'm moving it.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#18 2008-08-23 22:24:14

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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

 

#19 2008-08-23 22:27:47

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: The sudoku algorithm.(solving)

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


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#20 2008-08-26 16:10:57

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: The sudoku algorithm.(solving)

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

 

#21 2008-09-03 17:58:09

brundibar
Scratcher
Registered: 2008-09-03
Posts: 1

Re: The sudoku algorithm.(solving)

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  smile 
http://sudoku.ulesa.cz

Offline

 

Board footer