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
This commit is contained in:
Michael R Sweet 2006-08-24 18:09:44 +00:00
parent bd4d11e5e3
commit f5cbdbb1b5
2 changed files with 37 additions and 10 deletions

14
CHANGES
View File

@ -1,15 +1,17 @@
CHANGES IN FLTK 1.1.8
- Fixed filechooser to behave as documented when
file pattern changes (STR #135s9)
- Updated the Sudoku game to show a notice about Hard and
Impossible puzzles having multiple solutions which are
not a bug or error (STR #1361)
- Fixed filechooser to behave as documented when file
pattern changes (STR #1359)
- Completed the global function index and added an
alphabetical list of all methods (STR #1319)
- Avoiding problems with some platforms that don't
implement hypot() (STR #1366)
- Fixed floating point value formatting
for Fl_Spinner (STR #1331)
- Fixed Fl_Positioner callback
when released (STR #1387)
- Fixed floating point value formatting for Fl_Spinner
(STR #1331)
- Fixed Fl_Positioner callback when released (STR #1387)
- Fixed WIN32 zero size window issue (STR #1387)
- Fixed Sudoku window positioning (STR #1398)
- Fluid Code Declarations can now handle

View File

@ -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);
}
}
}