Skip to content

Conversation

@kristina-arezina
Copy link

I have made a new game and redo feature with the use of buttons. Also, I have made a tally of the user's attempts while playing a round of the game, and their score which tracks how many matches they made within a game. Lastly, I have made a message that pops up when the user completed all the matches.

All the features I added are in the div with the class of extra on the HTML page of video-11.

The New Game and Redo buttons work by calling the newGame or redo functions respectively. In scripts.js for video-11 the newGame function shuffles the cards and then calls the redo function which resets all variables and turns over the cards using a for loop.

In the function score, the scoreNum variable increases each time the function is called and outputs the score along with a message. Also, if the score becomes equivalent to 6 (the number of matches possible) the function outputs a congratulatory message.

In the attempts function, each time it is called the attemptsNum variable increases and the new value gets outputted along with a message.

…, I have made a tally of the user's attempts while playing a round of the game, and their score which tracks how many matches they made within a game. Lastly, I have made a message that pops up when the user completed all the matches.

All the features I added are in the div with the class of extra on the HTML page of video-11.

The New Game and Redo
buttons work by calling the newGame or redo functions respectively. In scripts.js for video-11 the newGame function shuffles the cards and then calls the redo function which resets all variables and turns over the cards using a for loop.

In the function score, the scoreNum variable increases each time the function is called and outputs the score along with a message. Also, if the score becomes equivalent to 6 (the number of matches possible) the function outputs a congratulatory message.

In the attempts function, each time it is called the attemptsNum variable increases and the new value gets outputted along with a message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant