Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Quickcheck candidates/ SolveSound

60 views
Skip to first unread message

Johan NH

unread,
Dec 1, 2014, 10:00:58 AM12/1/14
to chalmer...@googlegroups.com
Hi! I have a question regarding quickchecking the properties prop_candidates and prop_SolveSound. 
Both props take a sudoku generated by quickCheck, but the problem is that these generated sudokus are extremly rarely valid , 
so in my test cases I get "quickcheck gave up".

Are we supposed to redesign the implemenation of the sudoku generator or what am I missing?

Thanks in advance!

//Johan

David Sands

unread,
Dec 1, 2014, 10:11:32 AM12/1/14
to chalmer...@googlegroups.com, Johan NH

That does not sound like the problem we expect to see (as described by the hint).  You should not be generating bad sudoku.

Did you check prop_Sudoku ? 

Johan NH

unread,
Dec 1, 2014, 10:23:59 AM12/1/14
to chalmer...@googlegroups.com
prop_sudoku is only testing that each cell includes Nothing or a number between 1-9 and that there are 9 rows with 9 cols in each.(As specified by A2)
But there is nothing that checks that all generated sudokus have valid blocks (that only unique number occur in each block)

The given generator generates 9x9 cells, where each cell is either a number 1-9 or nothing, but there is no check that the blocks are valid.

Dave

unread,
Dec 1, 2014, 10:38:09 AM12/1/14
to chalmer...@googlegroups.com
Then it must be because you are generating sudokus with quite a lot of numbers in them (more likely to be invalid).  

If you can increase the number of blanks in your sudokus then more of them will be valid (and then you will see the usual problem described in the hint). 

You don't really have to solve this issue as generating valid sudokus is tricky. 

andersmortberg

unread,
Dec 1, 2014, 10:40:18 AM12/1/14
to chalmer...@googlegroups.com
Do you have the correct probabilities in cell? There should be about 10% numbers in the generated sudokus which makes them most likely solvable. If you have more numbers they will most likely not be solvable.

--
Anders

Johan NH

unread,
Dec 2, 2014, 3:18:16 AM12/2/14
to chalmer...@googlegroups.com
Changing the probability rates in cell did the trick! Thanks!


Den måndagen den 1:e december 2014 kl. 16:00:58 UTC+1 skrev Johan NH:
Reply all
Reply to author
Forward
0 new messages