I am creating a math game where the computer outputs a question and 3 random answers and 1 correct answer in different boxes. You get a point for every question correct.
I was having trouble figuring out a way to create a random number to every other box other than 1 which has the answer to the question. I didn't want the box to be the same every time. How may I accomplish this?
Here is the code:
https://stackblitz.com/edit/react-fkuqam.
P.S(It would be ideal if it could happen without changing the whole code to a class-based component but not at all necassary)
samedi 14 mars 2020
How do you make a random number in a random box in react with hooks?
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire