mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 06:10:49 +02:00
Make Math * Less Painful
This commit is contained in:
+32
-14
@@ -23,20 +23,38 @@ class MathGameCommand extends commando.Command {
|
||||
let [level] = message.content.toLowerCase().split(" ").slice(1);
|
||||
let randomType = ['+', '-', '*'];
|
||||
randomType = randomType[Math.floor(Math.random() * randomType.length)];
|
||||
let randomValue;
|
||||
switch (level) {
|
||||
case "easy":
|
||||
randomValue = 10;
|
||||
break;
|
||||
case "medium":
|
||||
randomValue = 50;
|
||||
break;
|
||||
case "hard":
|
||||
randomValue = 100;
|
||||
break;
|
||||
case "extreme":
|
||||
randomValue = 1000;
|
||||
break;
|
||||
if(randomType === '*') {
|
||||
let randomValue;
|
||||
switch (level) {
|
||||
case "easy":
|
||||
randomValue = 10;
|
||||
break;
|
||||
case "medium":
|
||||
randomValue = 12;
|
||||
break;
|
||||
case "hard":
|
||||
randomValue = 15;
|
||||
break;
|
||||
case "extreme":
|
||||
randomValue = 20;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
let randomValue;
|
||||
switch (level) {
|
||||
case "easy":
|
||||
randomValue = 10;
|
||||
break;
|
||||
case "medium":
|
||||
randomValue = 50;
|
||||
break;
|
||||
case "hard":
|
||||
randomValue = 100;
|
||||
break;
|
||||
case "extreme":
|
||||
randomValue = 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let randomValue1 = Math.floor(Math.random() * randomValue) + 1;
|
||||
let randomValue2 = Math.floor(Math.random() * randomValue) + 1;
|
||||
|
||||
Reference in New Issue
Block a user