New variant idea
[xogo.git] / utils / alea.js
index 751d347..d892824 100644 (file)
@@ -22,10 +22,14 @@ export const Random = {
       min = 0;
     }
     if (!Random.rand)
-      Random.setSeed(Math.floor(Math.random() * 1984));
+      Random.setSeed(Math.floor(Math.random() * 19840));
     return Math.floor(Random.rand() * (max - min)) + min;
   },
 
+  randBool: function() {
+    return Random.randInt(0, 2) == 0;
+  },
+
   // Inspired by https://github.com/jashkenas/underscore
   sample: function(arr, n) {
     n = n || 1;