80 likes | 104 Views
Engage users with a interactive "Spot the Difference" game. Test your observation skills by identifying which item is different from the rest. Click to make a guess and see if you're correct! Customize the color feedback for correct and incorrect choices.
E N D
Lab 2 One of these things is not like the other CSD 340 (Blum)
Make a page like the one shown below. CSD 340 (Blum)
The game • In the game, two of the items in a row have something in common, and the third item is different. • The user is to click on his or her guess. The page should indicate whether the choice is correct in two ways: an alert box saying correct or incorrect and color (my version uses white for correct and red for incorrect.) CSD 340 (Blum)
Incorrect Example Part 1: Message CSD 340 (Blum)
Incorrect Example Part 2: Color CSD 340 (Blum)
Correct Example Part 1: Message CSD 340 (Blum)
Correct Example Part 2: Color CSD 340 (Blum)
One Function • Try to write your code using one function. • Mine had three arguments: • The id of the cell containing the image clicked, so I could change its color. • The RGB code of the color I wanted the cell to turn. • The word ‘correct’ or ‘incorrect’ as the case may be. CSD 340 (Blum)