Build a Rock, Paper, Scissors Game - Step 6

Tell us what’s happening:

  1. Your getRoundResults function should return the correct message based on who wins the round. If no one wins, the message should say it’s a tie.
    I don’t see anything wrong with the Message

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region
if (hasPlayerWonTheRound(userOption, computerChoice)) {
    // Player wins
    playerScore += 1;  // update the score
    return `Player wins! ${userOption} beats ${computerChoice}`;
  } else if (userOption === computerChoice) {
// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36

Challenge Information:

Build a Rock, Paper, Scissors Game - Step 6

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-rps-game/66cf33305293e1b35c1aef7f.md at main · freeCodeCamp/freeCodeCamp · GitHub

Tell us what’s happening:

  1. Your getRoundResults function should return the correct message based on who wins the round. If no one wins, the message should say it’s a tie.
    what did I do wrong here?

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region
if (hasPlayerWonTheRound(userOption, computerChoice)) {
    // Player wins
    playerScore += 1;  // update the score
    return `Player wins! ${userOption} beats ${computerChoice}`;
  } else if (userOption === computerChoice) {
// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36

Challenge Information:

Build a Rock, Paper, Scissors Game - Step 6

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-rps-game/66cf33305293e1b35c1aef7f.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @Ruhollahbayani,

I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.

Thank you.

function getRoundResults(userOption) {
  const computerResult = getRandomComputerResult();
  
  
}

You have changed this starting code. Please reset this step and try again.

Happy coding

Thank you for your help