summaryrefslogtreecommitdiff
path: root/puzzle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'puzzle.cpp')
-rw-r--r--puzzle.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/puzzle.cpp b/puzzle.cpp
index 461549b..947e7ba 100644
--- a/puzzle.cpp
+++ b/puzzle.cpp
@@ -17,7 +17,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * $Id: puzzle.cpp 108 2008-01-06 16:01:26Z tom $
+ * $Id: puzzle.cpp 109 2008-01-06 19:43:20Z tom $
*/
#include "puzzle.h"
@@ -247,6 +247,14 @@ unsigned int Puzzle::numbers_count(Pos pos)
return count[pos];
}
+/** Is this number in this cell a possible number? */
+bool Puzzle::possible_number(Pos pos, unsigned int number)
+{
+ assert(pos <= Pos::last());
+ assert(0 <= number && number <= DIM);
+ return numbers[pos][number];
+}
+
/** Compute all possible numbers for this cell. */
void Puzzle::compute_numbers(Pos pos)
{