IDNStudy.com, kung saan ang iyong mga tanong ay natutugunan ng mga maaasahang sagot. Ang aming komunidad ay handang magbigay ng malalim at praktikal na mga solusyon sa lahat ng iyong mga katanungan.
Answer:
You can generate random numbers, do the math to get the answer your expect, and then compare your expected answer with the actual answer of the user :
var a = Math.floor(Math.random() * 10); // A number between 0 and 10
var b = Math.floor(Math.random() * 10); // Another number between 0 and 10
var expectedAnswer = a + b;
var answer = prompt(a + " + " + b);
if (answer == expectedAnswer)
alert('Good job !');
else
alert('Wrong answer :()');
Explanation:
hope this helps. it's about complicated