More sound effects, drop solution dialog (green tiles mean solved...)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4686 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-12-06 03:55:45 +00:00
parent 11349b0c63
commit 9a52731601

View File

@ -592,14 +592,15 @@ Sudoku::check_game(bool highlight) {
if (!empty && correct) {
// Success!
for (i = 0; i < 9; i ++)
for (i = 0; i < 9; i ++) {
for (j = 0; j < 9; j ++) {
SudokuCell *cell = grid_cells_[i][j];
cell->color(FL_GREEN);
cell->readonly(1);
}
fl_message("Congratulations, you solved the game!");
sound_->play('A' + grid_cells_[i][8]->value() - 1);
}
}
}
@ -919,18 +920,16 @@ void
Sudoku::solve_game() {
int i, j;
for (i = 0; i < 9; i ++)
for (i = 0; i < 9; i ++) {
for (j = 0; j < 9; j ++) {
SudokuCell *cell = grid_cells_[i][j];
bool play_note = false;
if (cell->value() != grid_values_[i][j]) play_note = true;
cell->value(grid_values_[i][j]);
cell->readonly(1);
cell->color(fl_color_average(FL_GRAY, FL_GREEN, 0.5f));
cell->color(FL_GRAY);
}
if (play_note) sound_->play('A' + cell->value() - 1);
sound_->play('A' + grid_cells_[i][8]->value() - 1);
}
}