qsu
Version:
qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.
1 lines • 152 B
JavaScript
export function numPick(n,r){if(!n&&!r)return Math.random()>.5?1:0;const t=r||n,o=!r||n>=r?null:n;return Math.floor(Math.random()*(o?t-o+1:t+1))+(o||0)}