Homework 3.8 Sudoku: An Edge case

I have found the following Edge case:

list_ch = [[1,2,3],
           [2,1,3],
           [3,1,2]]

Should it return False, in the same way this one does?:

incorrect = [[1,2,3,4],
             [2,3,1,3],
             [3,1,2,3],
             [4,4,4,4]]

Thanks!

asked 07 Mar '12, 14:27

victor%20martinez-2's gravatar image

victor marti...
1.1k51442
accept rate: 21%

Please mark this question as answered!

(08 Mar '12, 21:09) Monty Monty's gravatar image

3 Answers:

I don't see how that's an edge case. Yes, it should return False; the second and third columns are invalid.

link

answered 07 Mar '12, 14:28

Thom%20Blake's gravatar image

Thom Blake
4.4k104681

Yup, Edge case is too much "yellowish".
But I hope it helps people to not just go working via Rows but also via Columns. Or they will score a Failed ;)
I have to rework my code after finding this specific case. My code wasn't able to discover this is a false Sudoku at all.

(07 Mar '12, 14:32) victor marti... victor%20martinez-2's gravatar image

@vicmarcal What does "yellowish" mean in this context?

(07 Mar '12, 14:33) Thom Blake Thom%20Blake's gravatar image

That will definitely return false because it does not meet the requirements of a standard Sudoku! You cannot have the same values in the same column, like 3, 3 1 etc. good luck

link

answered 07 Mar '12, 14:30

Eenvincible's gravatar image

Eenvincible
3.6k164179

You must not only check the rows and columns, but according to exercise statement you must also check that numbers are 1 to 3 for the first grid, or 1 to 4 for the second

I won't give more hints at this point ;-)

link

answered 07 Mar '12, 15:17

Emilio%20Gonzalez-1's gravatar image

Emilio Gonza...
2.0k72044

Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15,323
×195
×13
×9
×2

Asked: 07 Mar '12, 14:27

Seen: 330 times

Last updated: 08 Mar '12, 21:09