Reply
Fri 4 Jan, 2013 05:04 pm
Define the predicate region/4 such that region(+M,+K,+Size,?L) is satised if L is the list of all elements of region number K of the sudoku grid of size Size represented by matrix M. We recall that a sudoku grid of base n is represented by a square matrix of size n2. We consider here that regions are numbered from left to right, and top to bottom. In a sudoku grid of base 3, region 1
would be the one if the top-left corner, with regions 2 and 3 to its right, and region 4 . A region is always a sub grid of size n n. One can compute the coordinates of the top-left element of a region using operators div and mod.