Coding gnome-sudoku



Hi,

I have managed to setup an environment where I can do some work on gnome-sudoku.

Let me start with what I want to accomplish before I ask my question.

When playing the game and selecting a difficulty, e.g pressing one of the 4 buttons:
  easy_button
  medium_button
  hard_button
  very_hard_button
(leaving out the create_game_button for the moment)
I would like to get the first unsolved board to display when I do a "quick click"
and if I do a "long click" I would like to get up a list showing all current games
on disk (both solved and unsolved) with the solved ones in different font and being
able to click on one of the games in the list (either unsolved or solved) and play/replay
that board.
A game is just a number, corresponds currently to index into gen_boards created by:
-- start copy from gnome-sudoku.vala --
        SudokuGenerator.generate_boards_async.begin (1, selected_difficulty, null, (obj, res) => {
            try
            {
                var gen_boards = SudokuGenerator.generate_boards_async.end (res);
                back_button.sensitive = true;
                start_game (gen_boards[0]);
            }
-- end copy from gnome-sudoku.vala --

My plan is to store the status of these lists of games (one list per difficulty) in suitable file on disk and
have the application make sure there always is a (selectable?) number of unsolved games
when playing.

If this specification is clear then here is my question.

1)  The board generation is run by a Worker which eventually ends up at:
          puzzle = QQwing.generate_puzzle ((int) category);   // in sudoku-generator.vala
     So when the first run is performed for a number of boards how do I get new boards when
     I need to fill up the list?





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]