pxt-calliope/libs/core/helpers.ts
Sam El-Husseini 277d5a721c rename "microbit" package to "core" ()
* rename "microbit" package to "core" 

* shouldn't edit the package id.

* updating package.json

* updated the wrong version

* missed updating pxt.json of tests
2016-10-10 16:21:50 -07:00

17 lines
446 B
TypeScript

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;
}
}