fjas
This commit is contained in:
13
server/utils/dice.js
Normal file
13
server/utils/dice.js
Normal file
@@ -0,0 +1,13 @@
|
||||
export function withSides(sides) {
|
||||
const r = Math.random()
|
||||
return Math.floor(r * sides) + 1;
|
||||
}
|
||||
|
||||
export function d6() {
|
||||
return withSides(6);
|
||||
}
|
||||
|
||||
export function d8() {
|
||||
return withSides(8);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user