[gnome-games/sudoku-vala] sudoku: Implement resetting game
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/sudoku-vala] sudoku: Implement resetting game
- Date: Mon, 19 Dec 2011 10:45:50 +0000 (UTC)
commit e4950f609eaf9adcd377754fd86a4a3502d19d91
Author: LubomÃr SedlÃÅ <lubomir sedlar gmail com>
Date: Thu Jul 28 13:45:03 2011 +0200
sudoku: Implement resetting game
gnome-sudoku/src/sudoku-game.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gnome-sudoku/src/sudoku-game.vala b/gnome-sudoku/src/sudoku-game.vala
index 24eecc8..f8eb15b 100644
--- a/gnome-sudoku/src/sudoku-game.vala
+++ b/gnome-sudoku/src/sudoku-game.vala
@@ -118,7 +118,13 @@ public class SudokuGame
public void reset ()
{
- stdout.printf ("TODO: reset\n");
+ for (int i = 0; i < 9; i++) {
+ for (int j = 0; j < 9; j++) {
+ if ( ! cells[i,j].is_fixed) {
+ cells[i,j].value = 0;
+ }
+ }
+ }
}
private void cell_changed_cb (SudokuCell cell)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]