let number1, operator, number2;
let validNumber = false;
number1 = Math.floor(Math.random() * 90) + 10;
number2 = Math.floor(Math.random() * 8) + 2;
operator = '/';
// 循环直到找到一个合适的数字
do {
validNumber = number1 % number2 === 0;//有这一句有时候正常,有时候还是会死机
} while (!validNumber);
result = number1 / number2;
question = `${number1} ${operator} ${number2}`;
if(operator=='*')
{
fhao='×';
}
else
{
fhao='÷';
}
question1 = `${number1} ${fhao} ${number2}`;
setTimeout(() => {
displayQuestion(question1, '', '=');
}, shijian*1000);
validNumber = number1 % number2 === 0;//有这一句有时候正常,有时候还是会死机