Question
I need to create a match the number game in Javascript and meets the following criteria 1. There is a 5 X 5 grid table
I need to create a match the number game in Javascript and meets the following criteria
1. There is a 5 X 5 grid table that contains random numbers.(already completed the coded for it using gamerarray[])
2. The program will call out a number from the table of random numbers already created.
3.User will need to click on the grid that contain the number that matches the number called out
4. If user select the correct number, It will alert 'correct number', score will update by 1. the program will then randomly generate unique numbers within the 5 X 5 grids after user close the alert message
5. If user select the wrong number, it will alert' wrong number'. The numbers in the 5 X 5 grid will remain unchange till user select the correct answer.
Attached image is the codes that i have created so far. However, i was prompt that selection was wrong for any grid that i click on.
Please help to point out the error in the code
Thanks
var score $('#boxe s').click (function ()/tid from html table*/ if (gamearr [randNum]/*variable use for table array*randomgenerator/*number called*/) alert ('You have selected the correct number!') score score + 1 ; document.getElementById ("hitTxt").innerHTML = " " + score + " "; else alert ('You have selected the wrong numberStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started