Skip to content

roll

Rolls an n-sided die.

Usage

ts
import { roll } from 'tsu'

roll(10)
// returns `true` 1 in 10 times

Type Definitions

ts
/**
 * @param n - The number of sides on the die.
 * @returns If the die roll was 0.
 */
function roll(n: number): boolean

Released under the MIT License.