BTW half a teaspoon of mustard and a dollop of Worcestershire sauce in the roux mix makes it taste amazing :D ]]>

The workhorse routine was called TestSubset(), and it’s given an array of bitflags that represents a 2D possibility list. The columns and rows in the array represent different constraints. For instance, for a regular naked/hidden subset, the columns of the array represent unfilled constraints for a given column/row/box (e.g., box 1 must have a 2, box 1 must have a 7, etc.), and the rows represent the possibilities. The same TestSubset() routine can also be used to handle the X-Wing and fish patterns, by filling in the flags array differently.

TestSubset() is a bit of a bear, and I was fairly stupid about commenting it so that I now have trouble following the logic, but the meat of it is basically about trying each subset of possibilities in set A to see if the bitflags (possibilities in set B) for any given N of A would OR to an integer with no more than N bits. If so, then a subset is found. (Anything else in A with those same bits in B can be eliminated.) Maybe I can make a post of this soon, but with code that’s easier to follow.

]]>slainte

]]>