X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=utils%2Falea.js;h=d892824f14246a45508a55b573658955a1b77427;hb=0adfbdb55452c79532875beb8eed61b1ed4c6cd2;hp=077970df5df333a432e65ae189cf18b423d729e4;hpb=f3824309fa7dffd121ebb859088362997cabe9c3;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;