added math.randomBoolean
This commit is contained in:
		@@ -4,3 +4,14 @@ namespace console {
 | 
				
			|||||||
        serial.writeString("\r\n");
 | 
					        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=210
 | 
				
			||||||
 | 
					    export function randomBoolean(): boolean {
 | 
				
			||||||
 | 
					        return Math.random(2) == 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user