2.1.28, initiation update to PXT v5.28.24 (#54)
This commit is contained in:
committed by
Peli de Halleux
parent
38a964516e
commit
5c114a0c57
@@ -1,17 +1,10 @@
|
||||
namespace console {
|
||||
export function log(msg: string) {
|
||||
serial.writeString(msg);
|
||||
serial.writeString("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
namespace Math {
|
||||
/**
|
||||
* Generates a `true` or `false` value randomly, just like flipping a coin.
|
||||
*/
|
||||
//% blockId=logic_random block="pick random true or false"
|
||||
//% help=math/random-boolean color=230
|
||||
//% help=math/random-boolean weight=0 color=712672
|
||||
export function randomBoolean(): boolean {
|
||||
return Math.random(2) == 0;
|
||||
return Math.randomRange(0, 1) === 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user