X-Git-Url: https://git.auder.net/images/pieces/%24%7BgetWhatsApp%28link%29%7D?a=blobdiff_plain;f=utils%2Falea.js;h=d892824f14246a45508a55b573658955a1b77427;hb=d01282a527e60af95f2a71deee1fbac9c0dd26be;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;