From c9b269e2ce94163cb75c14070a579f3cc8a51163 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 4 Jun 2018 11:47:12 -0700 Subject: [PATCH] tweak to helpers --- libs/core/helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/core/helpers.ts b/libs/core/helpers.ts index 8e06cca7..8c18311b 100644 --- a/libs/core/helpers.ts +++ b/libs/core/helpers.ts @@ -12,6 +12,7 @@ namespace Math { //% blockId=logic_random block="pick random true or false" //% help=math/random-boolean weight=0 export function randomBoolean(): boolean { - return Math.floor(Math.randomRange(0, 1) * 2) == 1; + const v = Math.randomRange(0, 1) * 2; + return 1 == Math.floor(v); } } \ No newline at end of file