* rename "microbit" package to "core" #414 * shouldn't edit the package id. * updating package.json * updated the wrong version * missed updating pxt.json of tests
This commit is contained in:
committed by
Peli de Halleux
parent
80131f2928
commit
277d5a721c
17
libs/core/helpers.ts
Normal file
17
libs/core/helpers.ts
Normal file
@ -0,0 +1,17 @@
|
||||
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
|
||||
export function randomBoolean(): boolean {
|
||||
return Math.random(2) == 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user