Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
lkhiger

New User

Joined: 28 Oct 2005
Posts: 89

 Posted: Mon Sep 28, 2009 7:20 pm    Post subject: Terminator for MegaSUDOKU There is level-3 sudoku, having 2 empty lines: Sudoku Line XXXXXXXXX X7XXX6X3X X3X72XX4X 7XXXX8XX1 6XX3X7XX5 5X91XXXXX X8XX91X2X X916XXX7X XXXXXXXXX Line 1: | 9 | 6 | 2 | 8 | 3 | 4 | 1 | 5 | 7 | Line 2: | 8 | 7 | 4 | 5 | 1 | 6 | 9 | 3 | 2 | Line 3: | 1 | 3 | 5 | 7 | 2 | 9 | 6 | 4 | 8 | Line 4: | 7 | 2 | 3 | 9 | 5 | 8 | 4 | 6 | 1 | Line 5: | 6 | 1 | 8 | 3 | 4 | 7 | 2 | 9 | 5 | Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 7 | 8 | 3 | Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 | Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 3 | 7 | 4 | Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 8 | 1 | 9 | Our solver spent 11 second to find this single solution. Now we make simple experiment: we'll change line 4 by remove 1 from source string: 7XXXX8XX1==> 7XXXX8XX0 We expect the same single solution, but not. Because we have 2 empty lines we'll have multiple solutions. Ok, every solution will shown to you, but how ? Line 1: ........ Line 1: ........ .................. Line 1: ........ Line 2: ........ Line 2: ........ .................. Line 2: ........ etc. How combine these lines in complete sudoku solutions ? For this I created the new termin (column) named Weight. The weight has to be unique for every single solution. Weight = 'Line 1:... ' || 'Line 2:... ' ||.... || 'Line 9:... '. Then I used Group By and Order BY for Weight & Line##. As Result: Sudoku Line XXXXXXXXX X7XXX6X3X X3X72XX4X 7XXXX8XXX 6XX3X7XX5 5X91XXXXX X8XX91X2X X916XXX7X XXXXXXXXX Line 1: | 1 | 6 | 2 | 8 | 3 | 4 | 7 | 5 | 9 |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 | 9 | 5 | Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 7 | 8 | 3 | Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 | Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 3 | 7 | 4 | Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 8 | 1 | 9 | Line 1: | 9 | 6 | 2 | 8 | 3 | 4 | 7 | 5 | 1 | Line 2: | 8 | 7 | 4 | 5 | 1 | 6 | 9 | 3 | 2 | Line 3: | 1 | 3 | 5 | 7 | 2 | 9 | 6 | 4 | 8 | Line 4: | 7 | 1 | 3 | 9 | 5 | 8 | 2 | 6 | 4 | Line 5: | 6 | 2 | 8 | 3 | 4 | 7 | 1 | 9 | 5 | Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 3 | 8 | 7 | Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 | Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 4 | 7 | 3 | Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 8 | 1 | 9 | Line 1: | 9 | 6 | 2 | 8 | 3 | 4 | 7 | 5 | 1 | Line 2: | 8 | 7 | 4 | 5 | 1 | 6 | 9 | 3 | 2 | Line 3: | 1 | 3 | 5 | 7 | 2 | 9 | 6 | 4 | 8 | Line 4: | 7 | 2 | 3 | 9 | 5 | 8 | 1 | 6 | 4 | Line 5: | 6 | 1 | 8 | 3 | 4 | 7 | 2 | 9 | 5 | Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 3 | 8 | 7 | Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 | Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 4 | 7 | 3 | Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 8 | 1 | 9 | we got 8 different solutions in 1 minute. P.S. Code in an attachment

 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Find corresponding Scope Terminator TS70363 COBOL Programming 2 Fri Jun 11, 2010 4:16 pm Copybook Scope Terminator within IF/E... ramanindya55 COBOL Programming 3 Thu Mar 18, 2010 8:27 pm SQL concatenation is taking ' as the ... William Thompson DB2 6 Thu Feb 01, 2007 6:48 pm What is the use of cobol scope termin... niharika1234 COBOL Programming 3 Tue May 02, 2006 2:28 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us