Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

SQL Sudoko Expand / Collapse
Author
Message
Posted Monday, June 12, 2006 3:04 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 9:02 AM
Points: 2,915, Visits: 1,849
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/dpoole/sqlsudoko.asp

LinkedIn Profile
Newbie on www.simple-talk.com
Post #286859
Posted Thursday, June 22, 2006 2:33 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: Administrators
Last Login: Sunday, November 16, 2014 11:00 AM
Points: 31, Visits: 47
This is not the first TSQL Sudoku puzzle solver/generator (see, for example The Sudoku Puzzle Generator. However, it is nicely explained. The two approaches are completely different. Perhaps, with Phil's puzzle generator and this solver, a SQL Server system could keep itself amused for ever!

Editor: Simple-Talk
Post #289279
Posted Thursday, June 22, 2006 2:56 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, November 21, 2014 12:55 AM
Points: 271, Visits: 153
Other sql soduko's:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50372

Nice job David P.

rockmoose



You must unlearn what You have learnt
Post #289284
Posted Thursday, June 22, 2006 7:46 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, July 24, 2014 1:52 PM
Points: 290, Visits: 52
I'm not a fan of Sudoko, but I really enjoyed this article.  Good work!

John Scarborough
MCDBA, MCSA
Post #289336
Posted Thursday, June 22, 2006 8:12 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, April 17, 2014 3:29 AM
Points: 229, Visits: 421

I like Sudokus, the hard one's particularly. Couple of observations :

1) Very nice and all, but perhaps you have a little too much time on your hands?

2) Slippery little algorithms for Sudokus aren't they? I'd never made the relationship between them and SQL server, I'm thinking they're good brain food for coding....

All in all, impressive, but pointless

Keep up the good work...

 

Post #289355
Posted Thursday, June 22, 2006 8:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 26, 2014 8:23 AM
Points: 2, Visits: 14
I think this is great and plan on spending the next two weeks testing !  Who cares if all the other applications I support go down ... I'll be busy testing
Post #289382
Posted Thursday, June 22, 2006 9:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 23, 2007 11:05 AM
Points: 2, Visits: 1
I think I am missing something.  I have done all the code but it is not working right for me.
Post #289394
Posted Thursday, June 22, 2006 11:27 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 12:52 PM
Points: 1,945, Visits: 3,122
I have column coming up on www.dbazine.com on the same topic!! I used this as a programming exercise in a class I taught in Brazil. But my approach was to fill the (i, j, val) table/array at the start, then to delete the values that were disallowed. The result was much less code.

Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #289436
Posted Thursday, June 22, 2006 1:54 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 24, 2007 3:44 PM
Points: 2, Visits: 1
Two things are missing as far as I can see.
There is no CREATE-statement for the Sudoko table. But since the schema for the table is shown, it is trivial to put this in:

IF EXISTS (SELECT * FROM sys.tables WHERE Name='Sudoko')
DROP TABLE Sudoko

CREATE TABLE Sudoko (
RowId TinyINT NOT NULL,
ColumnID TinyINT NOT NULL,
CellValue TinyINT NULL,
CONSTRAINT pk_sudoko PRIMARY KEY (RowID, ColumnID)
)

A more serious problem occurs at the end of the final implementation of SolveSingleCells - where the sp calls the procedure RemoveSolvedCells. This procedure is not defined anywhere in the article.

Regards
Jens Gyldenkærne Clausen
Post #289494
Posted Thursday, June 22, 2006 2:11 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Sunday, June 22, 2014 6:53 PM
Points: 967, Visits: 388

Nice job.  Now I don't feel so silly for writing a FORTH interpreter in T-SQL.

 

jg

 

 

Post #289499
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse