Re: Coding gnome-sudoku





2016-07-29 19:34 GMT+02:00 Michael Catanzaro <mike catanzaro gmail com>:
On Fri, Jul 29, 2016 at 10:44 AM, Igor Lopez <igor lopez bredband net> wrote:
> Yes and that is my question,
>   How do I ensure that I will not get the same boards generated?

I would just assume that each generated puzzle will be unique. If you
want to check to be sure, you'd have to save all the boards previously
generated somewhere, then compare your new board against all previous
boards to make sure it's not the same.

We did have an embarrassing bug recently where we got duplicate
puzzles after restarting the game due to not seeding the RNG, but
that's fixed.
lo and behold, that was the reason why I wanted to improve the game and I
can confirm that the bug is gone in the gnome-sudoku I have built myself.
Came so far by printf debugging that I understood that all was done in the
qqwing module, e.g. it always just created one new board:
In the start_game_cb the call:
        SudokuGenerator.generate_boards_async.begin (1, selected_difficulty, null, (obj, res) => {
would have been more obvious if it were
        int nr_boards = 1;
        SudokuGenerator.generate_boards_async.begin (nr_boards, selected_difficulty, null, (obj, res) => {
I have now a better understanding of the flow but the main driver is gone ....
We will see if I find something eles to play with.


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