5 kyu
Sudoku Strategies - Hidden Single
22 of 47dfhwze
Loading description...
Puzzles
Algorithms
Game Solvers
Set Theory
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
For your Test #11 (refer to the grid below), I received the following error message: "r2c2=1 is not a valid hidden single: expected false to be true". Can you please explain why this is not a valid hidden single? If you look at the upper left 3x3 block, the middle field in the second row cannot contain a 2 (in the same 3x3 block), a 3 (in the same 3x3 block, a 4 (in the same column), a 5 (in the same 3x3 block), a 6 (in the same column), a 7 (in the same row), an 8 (in the same row), or a 9 (in the same 3x3) block. For that reason, the value of r2c2 can only contain a 1. Thanks in advance for your feedback.
2 5 8 | . . . | . . .
. . . | 5 8 . | . 7 .
3 . 9 | . 4 . | . . .
------+-------+------
. . . | . . . | . . .
. 6 . | . . . | . . .
. . . | . . . | . . .
------+-------+------
. 4 6 | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .
let's first format this
You found a "Naked Single", not a "Hidden Single". You found a cell with only 1 remaining candidate. Instead, you should be looking for candidates with 1 remaining cell in any given group.
Thank you for the clarification
I hope more people will solve this thing. This deserves to be published.
Thanks, I'm not sure I'll continue the series beyond these two strategies aimed at beginners. More advanced strategies are likely to remain in beta for ages ;)
Someone can approve it right now. I hope there'll be new ones in the series.
Approved. With some reluctance set the difficulty to five, since this was the average rating. I think it's a 4kyu, but who am I to disrespect public opinion?
No excuses for mr dfhwze.
The only other strategy I know is the X-wing, so I suggest you start working. ;-)
Thanks, here's the next one. An intermezzo, before moving to the harder strategies.
I made some slight changes to that one. You may want to hit the "reset" button before continueing.
The error message when a incorrect answer is returned is unhelpful:
At least it should say something like
r5c4=7 is not a naked single
. (rncn=x
means "fill X at this cell", andrncn<>x
means "remove X from candidates list of this cell". k9 notation would work too, but rncn is more commonly used)Good idea. For Sudoku players, this is usually 1-based, but as programmers we return indices 0-based. I think the least confusing thing to do is use 0-based indices (e.g. r0c8=1 instead of r1c9=1). Would you agree?
No, because both rncn and k9 are explicitly defined to be 1-based. Using 0-based indices would be a incorrect usage of the notation, which is worse than not using the notation in the first place.
If you want to use 0-based indices, you'll need to avoid existing notations so others are not confused by your usage.
Ok, but then I should mention this notation in the description. EDIT: updated
solved (for both kata's)