X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=utils%2Falea.js;h=751d3474b42a5fd6bebaefddb0fbf49d8a719e98;hb=HEAD;hp=077970df5df333a432e65ae189cf18b423d729e4;hpb=33b427488bb6ee5c505c3a024bccedbef763f80e;p=xogo.git diff --git a/utils/alea.js b/utils/alea.js index 077970d..d892824 100644 --- a/utils/alea.js +++ b/utils/alea.js @@ -26,6 +26,10 @@ export const Random = { 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;