summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2006-08-24 18:09:44 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2006-08-24 18:09:44 +0000
commitf5cbdbb1b52d615b446a84a18b7779d18820f302 (patch)
treef442332bd467a61985f498575855989192c5eb9b /test
parentbd4d11e5e33f499d3825ed236c48ef68001f99dd (diff)
Add wording and tweak difficulty levels so that the Easy and
Normal levels always generate "valid" Sudoku puzzles while Hard and Impossible are free to make Sudoku puzzles more fun/challenging (STR #1361) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5356 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/sudoku.cxx33
1 files changed, 29 insertions, 4 deletions
diff --git a/test/sudoku.cxx b/test/sudoku.cxx
index a328af8dd..e0b926ded 100644
--- a/test/sudoku.cxx
+++ b/test/sudoku.cxx
@@ -839,6 +839,23 @@ Sudoku::diff_cb(Fl_Widget *widget, void *d) {
s->new_game(s->seed_);
s->set_title();
+ if (diff > 1)
+ {
+ // Display a message about the higher difficulty levels for the
+ // Sudoku zealots of the world...
+ int val;
+
+ prefs_.get("difficulty_warning", val, 0);
+
+ if (!val)
+ {
+ prefs_.set("difficulty_warning", 1);
+ fl_alert("Note: 'Hard' and 'Impossible' puzzles may have more than "
+ "one possible solution.\n"
+ "This is not an error or bug.");
+ }
+ }
+
prefs_.set("difficulty", s->difficulty_);
}
}
@@ -866,7 +883,17 @@ Sudoku::help_cb(Fl_Widget *, void *) {
"only once in each column and row. In addition, each 3x3 subgrid\n"
"may only contain one of each number.</P>\n"
- "<P>This version of the puzzle is Copyright 2005 by Michael R Sweet</P>\n"
+ "<P>This version of the puzzle is copyright 2005-2006 by Michael R\n"
+ "Sweet.</P>\n"
+
+ "<P><B>Note:</B> The 'Hard' and 'Impossible' difficulty\n"
+ "levels generate Sudoku puzzles with multiple possible solutions.\n"
+ "While some purists insist that these cannot be called 'Sudoku'\n"
+ "puzzles, the author (me) has personally solved many such puzzles\n"
+ "in published/printed Sudoku books and finds them far more\n"
+ "interesting than the simple single solution variety. If you don't\n"
+ "like it, don't play with the difficulty set to 'High' or\n"
+ "'Impossible'.</P>\n"
"<H2>How to Play the Game</H2>\n"
@@ -1020,7 +1047,7 @@ Sudoku::new_game(time_t seed) {
}
// Show N cells...
- count = 10 * (5 - difficulty_);
+ count = 11 * (5 - difficulty_);
int numbers[9];
@@ -1050,8 +1077,6 @@ Sudoku::new_game(time_t seed) {
break;
}
}
-
- sound_->play('A' + t - 1);
}
}
}