summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-12-06 03:55:45 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-12-06 03:55:45 +0000
commit9a52731601e8bf3dafac3565d44de11c9dba610f (patch)
treed05707cb206693ff4efd7ad216644a946432ec63 /test
parent11349b0c6351a8dfd8a2471ee60309ac7c457d42 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/sudoku.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/sudoku.cxx b/test/sudoku.cxx
index d4094f7ec..39c77b356 100644
--- a/test/sudoku.cxx
+++ b/test/sudoku.cxx
@@ -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,19 +920,17 @@ 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));
-
- if (play_note) sound_->play('A' + cell->value() - 1);
+ cell->color(FL_GRAY);
}
+
+ sound_->play('A' + grid_cells_[i][8]->value() - 1);
+ }
}