tweak to helpers

This commit is contained in:
Peli de Halleux 2018-06-04 11:47:12 -07:00
parent 4078d41097
commit c9b269e2ce

View File

@ -12,6 +12,7 @@ namespace Math {
//% blockId=logic_random block="pick random true or false" //% blockId=logic_random block="pick random true or false"
//% help=math/random-boolean weight=0 //% help=math/random-boolean weight=0
export function randomBoolean(): boolean { 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);
} }
} }