From 755609c7b28b9faffd8a36c03f9ba23a8820a84b Mon Sep 17 00:00:00 2001 From: Weslie0803 Date: Mon, 24 Oct 2022 23:35:36 +0800 Subject: [PATCH] add .gitignore & remove restrict in randomnumber --- .gitignore | 2 ++ index.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..49c5775 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +抽奖软件UI.zip +analysis.md diff --git a/index.js b/index.js index 52eccc9..9a83502 100644 --- a/index.js +++ b/index.js @@ -41,8 +41,8 @@ $(document).ready(function () { var getRandomNum = function (usedNum, minNum, maxNum, size) { var randomNum = Math.round(Math.random() * (maxNum - minNum + 1) + minNum-0.5); - while(Math.floor(randomNum/10)-randomNum%10 == 0) - randomNum = Math.round(Math.random() * (maxNum - minNum + 1) + minNum-0.5); + // while(Math.floor(randomNum/10)-randomNum%10 == 0) + // randomNum = Math.round(Math.random() * (maxNum - minNum + 1) + minNum-0.5); usedNum.push(randomNum); var str = randomNum.toString(); while (str.length < size) str = '0' + str;