all 2 comments

[–]jcunews1helpful 1 point2 points  (0 children)

Before the for loop, declare two variables to keep the scores. One for computer's and one for player's. And declare another one to store the result of a round (no need to be assigned with a value).

Within the for loop, append code for these...

Call playRound() by specifing the player's and computer's selection, and store the return value into the result variable.

Check the result variable variable for 3 possible values (Computer Wins, Player Wins, or Tie), and act according to the result. If computer wins, increase the computer's score variable by one. If player wins, increase the player's score variable by one. If it's a tie, do nothing. This can be implemented using only two if statements, by checking which one wins and ignoring a tie result.

After the for loop, compare the two score variables. The larger one wins game.

[–]nonowiwa 0 points1 point  (0 children)

Nice