diff options
Diffstat (limited to 'puzzle.cpp')
-rw-r--r-- | puzzle.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: puzzle.cpp 11 2005-10-28 01:00:01Z tom $ + * $Id: puzzle.cpp 16 2005-10-31 21:12:41Z tom $ */ #include "puzzle.h" @@ -71,9 +71,15 @@ Puzzle::Puzzle(unsigned int givens_count, bool symmetric) generate(givens_count, symmetric); } -/** Reset the puzzle. */ +/** Reset the puzzle (including marks). */ void Puzzle::reset() { + reset(true); +} + +/** Reset the puzzle (either with or without marks). */ +void Puzzle::reset(bool clear_marks) +{ unsigned int i; // Fill the puzzle with the givens. @@ -85,8 +91,9 @@ void Puzzle::reset() compute_numbers(i); // Reset marked cells. - for (i = 0; i < SDIM; ++i) - marks[i] = false; + if (clear_marks) + for (i = 0; i < SDIM; ++i) + marks[i] = false; } /** Set the number into this cell. */ |