[PATCH 1/1] Introduce 10% random chance of generating a 4 tile.



Matches what the original 2048 game does, and makes the game a tad
bit harder with random chance.
---
 src/grid.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/grid.vala b/src/grid.vala
index 0787ede..1613f1f 100644
--- a/src/grid.vala
+++ b/src/grid.vala
@@ -72,7 +72,7 @@ public class Grid : Object
         if (_grid_is_full ())
             return false;
 
-        val = 2;
+        val = Random.next_double () < 0.9 ? 2 : 4;
 
         while (true)
         {
-- 
2.14.1



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