SudokuSolver Forum

A forum for Sudoku enthusiasts to share puzzles, techniques and software
It is currently Sat Apr 27, 2024 7:04 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: CANNOT IMPORT
PostPosted: Sun May 11, 2008 1:41 pm 
Offline
Regular
Regular

Joined: Sun May 11, 2008 1:38 pm
Posts: 7
CANNOT IMPORT THIS STRING

090400870100000009048070200020016000601900084007000600000600000003090100000000000
000090020000002308080130400008010006030009700000007000010500807000040002000070010
600000008090100030000000000000706010000000000010304000000000000030001040400000003
040070000100090000209003010000800000004900030900030400003029040705300000020050000
000000000001040200000003000006000300310004905000930010004090150100000009085001060

THIS IS Kazaguruma (Windmill) PUZZLE.


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Sun May 11, 2008 3:20 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Apr 23, 2008 5:29 am
Posts: 302
Location: Sydney, Australia
You should put the line of the central grid as the 5th line instead of the 3rd. :idea:

This code works:
Code:
090400870100000009048070200020016000601900084007000600000600000003090100000000000
000090020000002308080130400008010006030009700000007000010500807000040002000070010
040070000100090000209003010000800000004900030900030400003029040705300000020050000
000000000001040200000003000006000300310004905000930010004090150100000009085001060
600000008090100030000000000000706010000000000010304000000000000030001040400000003

:ugeek:

_________________
ADYFNC HJPLI BVSM GgK Oa m


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Sun May 11, 2008 3:27 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Mon Apr 21, 2008 10:32 am
Posts: 868
With this code there seems to be a bug in SudokuSolver 3.1.0. The solver aborts when trying "Solver > Solve Grid". JSudoku has no problems.
IMHO it would be better to post such problems directly under the forum thread for the application experiencing the problem.
I have sent the originator a PM.

_________________
Quis custodiet ipsos custodes?
Normal: [D  Y-m-d,  G:i]     PM->email: [D, d M Y H:i:s]


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Sun May 11, 2008 4:28 pm 
Offline
Site Admin

Joined: Sun Apr 13, 2008 1:50 pm
Posts: 191
Location: London
Hi

SudokuSolver strictly numbers grids from top left to bottom right (except for Clueless Grids, which are always last).

So, for a Windmill, the central grid should be the third line.

I've pasted the puzzle string into SS v3.1.0 and it solves fine. Make sure you set the extended puzzle type to Kazaguruma first before pasting the puzzle string. I need to do a bit more work on how SS identifies the puzzle type when the definition strings are ambiguous.

Rgds
Richard


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Sun May 11, 2008 5:46 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Mon Apr 21, 2008 10:32 am
Posts: 868
Richard,

With SS v3.1.0 I have the same problem as krishnenduray123.
I first explicitely selected Kazaguruma an then tried both "File > Import > Definiton" and Ctrl+V
The code for Regular Samurai #2A and the modified code posted by Matt both works fine!
:scratch:

EDIT:
Found the problem. The first 4 lines in krishnenduray123's code has an extra space at the end. If they are removed everything works fine. :D

What about some code cleaning before entering the code into the grids:
Code:
For ii = 0 To 32
    sudoku_code = Replace(Expression:=sudoku_code, Find:=Chr$(ii), Replace:=vbNullString, Start:=1)
Next

sudoku_code = Replace(Expression:=sudoku_code, Find:=Chr$(127), Replace:=vbNullString, Start:=1)

If (Mid$(sudoku_code, 1, 1) = """") Or (Mid$(sudoku_code, 1, 1) = "'") Then
    If Mid$(sudoku_code, Len(sudoku_code), 1) = Mid$(sudoku_code, 1, 1) Then sudoku_code = Mid$(sudoku_code, 1, Len(sudoku_code) - 1)
    sudoku_code = Mid$(sudoku_code, 2)
End If

If Len(sudoku_code) < min_required_len_sudoku_code Then
    Call MsgBox(Prompt:=Replace(MSG_too_little_code_data, "NNN", min_required_len_sudoku_code), Buttons:=vbOKOnly + vbCritical)
    Exit
End If


Public Const MSG_too_little_code_data   As String = "The sudoku code in the file or the clipboard has less than NNN characters."

_________________
Quis custodiet ipsos custodes?
Normal: [D  Y-m-d,  G:i]     PM->email: [D, d M Y H:i:s]


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Sun May 11, 2008 7:57 pm 
Offline
Site Admin

Joined: Sun Apr 13, 2008 1:50 pm
Posts: 191
Location: London
Børge wrote:
What about some code cleaning before entering the code into the grids
I'll need to take a look at why this isn't working - the program should be correctly strpping these out.

The character cleanup I do is a bit more sophisticated than your example - foe instance I allow candidates to be pasted in, and in that case embedded spaces are significant as a separator in that case.

But it should be completely stripping all non-digits to attempt to interpret the pasted string as a definition.

I'll go on a bug hunt.

Rgds
Richard


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Sun May 11, 2008 9:24 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Mon Apr 21, 2008 10:32 am
Posts: 868
rcbroughton wrote:
Børge wrote:
What about some code cleaning before entering the code into the grids
I'll need to take a look at why this isn't working - the program should be correctly strpping these out.

The character cleanup I do is a bit more sophisticated than your example - foe instance I allow candidates to be pasted in, and in that case embedded spaces are significant as a separator in that case.

But it should be completely stripping all non-digits to attempt to interpret the pasted string as a definition.

I'll go on a bug hunt.

Rgds
Richard

What about adding (an) error message(s) if you do not like the code. As it is now, nothing happens, and the user do no get any information why.

_________________
Quis custodiet ipsos custodes?
Normal: [D  Y-m-d,  G:i]     PM->email: [D, d M Y H:i:s]


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Mon May 12, 2008 1:38 am 
Offline
Regular
Regular

Joined: Sun May 11, 2008 1:38 pm
Posts: 7
You should put the line of the central grid as the 5th line instead of the 3rd.

This code works:
Code:
090400870100000009048070200020016000601900084007000600000600000003090100000000000
000090020000002308080130400008010006030009700000007000010500807000040002000070010
040070000100090000209003010000800000004900030900030400003029040705300000020050000
000000000001040200000003000006000300310004905000930010004090150100000009085001060
600000008090100030000000000000706010000000000010304000000000000030001040400000003


WHEN PASTED THIS CODE IT CHANGED THE POSITION OF THE NUMBERS. THE FULL PUZZLE CHANGED.


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Mon May 12, 2008 2:07 am 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Apr 23, 2008 5:29 am
Posts: 302
Location: Sydney, Australia
Well my code works for JSudoku, as it takes the 5th line as the central grid.

Richards's SudokuSolver takes the 3rd line as the central grid, so my code would not work there. Your original code would have work if you have deleted the extra spaces at the end of lines:
Code:
090400870100000009048070200020016000601900084007000600000600000003090100000000000
000090020000002308080130400008010006030009700000007000010500807000040002000070010
600000008090100030000000000000706010000000000010304000000000000030001040400000003
040070000100090000209003010000800000004900030900030400003029040705300000020050000
000000000001040200000003000006000300310004905000930010004090150100000009085001060

Suggestion to Richard: perhaps you could move this whole thread into the "Software" section while leaving a shadow copy here so that people can still find it here. :geek:

_________________
ADYFNC HJPLI BVSM GgK Oa m


Top
 Profile  
Reply with quote  
 Post subject: Re: CANNOT IMPORT
PostPosted: Mon May 12, 2008 2:23 am 
Offline
Regular
Regular

Joined: Sun May 11, 2008 1:38 pm
Posts: 7
udosuk wrote:
Well my code works for JSudoku, as it takes the 5th line as the central grid.

Richards's SudokuSolver takes the 3rd line as the central grid, so my code would not work there. Your original code would have work if you have deleted the extra spaces at the end of lines:
Code:
090400870100000009048070200020016000601900084007000600000600000003090100000000000
000090020000002308080130400008010006030009700000007000010500807000040002000070010
600000008090100030000000000000706010000000000010304000000000000030001040400000003
040070000100090000209003010000800000004900030900030400003029040705300000020050000
000000000001040200000003000006000300310004905000930010004090150100000009085001060

Suggestion to Richard: perhaps you could move this whole thread into the "Software" section while leaving a shadow copy here so that people can still find it here. :geek:



Thanks, it works


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group