From f5cbdbb1b52d615b446a84a18b7779d18820f302 Mon Sep 17 00:00:00 2001
From: Michael R Sweet
Date: Thu, 24 Aug 2006 18:09:44 +0000
Subject: 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
---
test/sudoku.cxx | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
(limited to 'test')
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.
\n"
- "This version of the puzzle is Copyright 2005 by Michael R Sweet
\n"
+ "This version of the puzzle is copyright 2005-2006 by Michael R\n"
+ "Sweet.
\n"
+
+ "Note: 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'.
\n"
"How to Play the Game
\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);
}
}
}
--
cgit v1.2.3