From a283cae416d2c1bc0107b82c67463ad3e1fec8bb Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 3 Feb 2023 18:02:10 -0800 Subject: [PATCH] Add randomInt() --- assets/scripts/nethack/dungeon.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/scripts/nethack/dungeon.js b/assets/scripts/nethack/dungeon.js index f11131b..6882d8b 100644 --- a/assets/scripts/nethack/dungeon.js +++ b/assets/scripts/nethack/dungeon.js @@ -319,6 +319,11 @@ class BSPNode { } } +function randomInt(n) { + max = Math.floor(n); + return Math.floor(Math.random() * max); +} + let grid; new p5(p => {