[gnome-taquin] Add a security.



commit 558618717f03b918043d995ea5f444d588e6845b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Feb 16 20:13:26 2019 +0100

    Add a security.
    
    It may happen that the game
    starts in final position...

 src/taquin-game.vala | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/taquin-game.vala b/src/taquin-game.vala
index ccdcb66..f1c331c 100644
--- a/src/taquin-game.vala
+++ b/src/taquin-game.vala
@@ -76,6 +76,11 @@ public class Game : Object
         this.game_type = game_type;
         tiles = new int[size, size];
 
+        do { generate_game (); } while (check_complete ());
+    }
+
+    private void generate_game ()
+    {
         var ntiles = size * size;
         var line = new int?[ntiles];
         var i = 0;


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