Sudoku SOLVED by LOGIC

Miscellaneous Forums/General Discussion/Sudoku SOLVED by LOGIC

http://www.instructables.com/id/EJLUBKN48JEPD7QXGR/?ALLSTEPS

Now backwards thinking will tell you how to create a SUDOKU generator and then you will have a new puzzle game or program to sell!

Interesting way of tackling it, may try that next time I take a stab at another Sudoku on my DS.
(too bad you cant "paint" on finished answers for annotation in the Brain Age Sudoku's though)

What I normally do is put possible candidates for each square in when I'm looking for a specific number, then work my way from there, problem as, as noted in the article, if I get distracted, I usually lose track of all the logic I had stored in my head. ;/

That's always the technique I use to do Sudokus.

I don't know why people even list possible candidates in Sudoku ... just fill in the numbers! I suppose on some of the harder ones that give less away it can be more challenging but still.

Have you ever actually tried one Jeremy? A hard one? Thought not ;-)

Same here, in fact it's the only one I've ever seen described.

You can still get stuck with it on some of the more complex puzzles, (the people who are really into these puzzles have names for the types of pattern where this approach doesn't work well!!)

I've played quite a bit and have never had to use place holders. So I suppose, no I haven't tried a difficult one.

Either that or you're a lot smarter than me - which is not unlikely :-)

Sudoku solved by logic?

It's a logic puzzle - how else would you do it? o_O

It's too time consuming writing all the numbers out at the start, there are easier methods.


It's a logic puzzle - how else would you do it? o_O
Trial & Error?

I don't know why people even list possible candidates in Sudoku
It helps alot (for me) in some cases where you find out a number in a square has to appear on a specific row/column....

Trial & Error?

I should have been more specific: how else would you sensibly do it? :oP

Do a crossword, you mindless number-ants!

It might not be that Jeremy has never done a difficult one, it might acctualy be that he is just intuitivly good at them, in a Rain man sort of way. (And I dont mean offence at Jeremy)

mrtricks (Posted 52 minutes ago)

Do a crossword, you mindless number-ants!
Ohhh Tricksie! You MUST be able to do better than that... as a flame that rated about a Bic Lighter - ;)

Have you gusy seen this?:

http://www.amazon.com/gp/product/1590596625/102-0045415-0588161?v=glance&n=283155

I saw it at the bookstore the other day, looks interesting. I am sure most of you would have no problem converting it to Blitz.

Wapner at 7 ....

wasn't there an article on cnn a while back that stated that a single formula had been found that solved ALL sudokus?

I've only done sudoku a couple times in the newspaper, but that article is the same way I naturally tried to solve them. (Except I didnt have an eraser both times...)

I just made a sudoku generator in blitz. It only took me a half hour cuz I am super smart!
It fails sometimes, so it just restarts.
SeedRnd MilliSecs()

Type cell
	Field value
	Field cantbe[9]
	Field cants
End Type

Dim grid.cell(9,9)


.top
For y=1 To 9
	For x=1 To 9
		grid(x,y)=New cell
	Next
Next


;draw the lines that make the grid
For y=1 To 9
	For x=1 To 9
		quadx=(x/3*3=x)
		quady=(y/3*3=y)
		Rect x*20,y*20,20-quadx,20-quady,0
	Next
Next

Local c.cell
Local best.cell
For y=1 To 9
	For am=1 To 9
	
		;find the cell on this row that can be the least amount of values
		best=Null
		For x=1 To 9
			c=grid(x,y)
			If c\value=0 Then
				If best=Null Then
					best=c
					cx=x
				ElseIf c\cants>best\cants Then
					best=c
					cx=x
				EndIf
			EndIf
		Next
		If best=Null Then Stop
		c=best
		
		;test if the cell can't be anything
		If c\cants=9 Then
			Cls
			Delete Each cell
			Goto top
		EndIf
		
		;give the cell a random number that it can be
		Repeat
			num=Rand(1,9)
			If c\cantbe[num]=0 Then Exit
			Delay 9
		Forever
		c\value=num
		Text cx*20,y*20,c\value
		
		;all in this row now cant be this value
		For x2=1 To 9
			If grid(x2,y)\cantbe[num]=0 Then
				grid(x2,y)\cantbe[num]=1
				grid(x2,y)\cants=grid(x2,y)\cants+1
			EndIf
		Next
		
		;all in this column now cant be this value
		For y2=y To 9
			If grid(cx,y2)\cantbe[num]=0 Then
				grid(cx,y2)\cantbe[num]=1
				grid(cx,y2)\cants=grid(cx,y2)\cants+1
			EndIf
		Next
		
		;all in this quadrant now cant be this value
		quadx=(cx-1)/3*3+1
		quady=(y-1)/3*3+1
		For y2=quady To quady+2
			For x2=quadx To quadx+2
				If grid(x2,y2)\cantbe[num]=0 Then
					grid(x2,y2)\cantbe[num]=1
					grid(x2,y2)\cants=grid(x2,y2)\cants+1
				EndIf
			Next
		Next
	Next
Next

;For y=1 To 9
;	For x=1 To 9
;		Text x*20,y*20,grid(x,y)\value
;	Next
;Next
Text 1,1,"done!"


WaitKey
End


THAT IS BRILLIANT!!! and well made too! OK I am officially impressed.


THAT IS BRILLIANT!!! and well made too! OK I am officially impressed.


Thanks! And thanks for the link too