From 6353d001a272ab6fb90617d69781d1d5b56d48bd Mon Sep 17 00:00:00 2001 From: Corey Bergeron Date: Tue, 11 Aug 2020 09:57:59 -0400 Subject: [PATCH] added 58008 to funbox --- public/funbox/list.json | 4 ++++ public/js/misc.js | 10 ++++++++++ public/js/script.js | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/public/funbox/list.json b/public/funbox/list.json index b66a07574..bf404a5b4 100644 --- a/public/funbox/list.json +++ b/public/funbox/list.json @@ -42,5 +42,9 @@ { "name": "gibberish", "type": "script" + }, + { + "name": "58008", + "type": "script" } ] \ No newline at end of file diff --git a/public/js/misc.js b/public/js/misc.js index f41c8fb9c..6a1f229dc 100644 --- a/public/js/misc.js +++ b/public/js/misc.js @@ -269,3 +269,13 @@ function getGibberish() { } return ret; } + +function getNumbers() { + let randLen = Math.floor(Math.random() * 7) + 1; + let ret = ""; + for (let i = 0; i < randLen; i++) { + randomNum = Math.floor(Math.random() * 9) + 1; + ret += randomNum.toString() + } + return ret; +} diff --git a/public/js/script.js b/public/js/script.js index cbd35e20c..079487e53 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -385,6 +385,9 @@ function initWords() { } else if (activeFunBox === "gibberish") { setPunctuation(false); wordsList.push(getGibberish()); + } else if (activeFunBox === "58008") { + setPunctuation(false); + wordsList.push(getNumbers()); } else { wordsList.push(randomWord); } @@ -572,6 +575,9 @@ function addWord() { if (activeFunBox === "gibberish") { randomWord = getGibberish(); } + if (activeFunBox === "58008") { + randomWord = getNumbers(); + } wordsList.push(randomWord); let w = "
";