From ef0d1275c99e9588b24407f52dff70038a657b6e Mon Sep 17 00:00:00 2001 From: Pascal Syma Date: Sun, 1 Dec 2024 16:25:57 +0100 Subject: [PATCH] Add random utils --- utils/random.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 utils/random.ts diff --git a/utils/random.ts b/utils/random.ts new file mode 100644 index 0000000..57b0478 --- /dev/null +++ b/utils/random.ts @@ -0,0 +1,5 @@ +export function randomInt(fromInclusive: number, toExclusive: number): number { + return ( + Math.floor(Math.random() * (toExclusive - fromInclusive)) + fromInclusive + ); +}