Rock, Paper, or Scissors

Rock, Paper, or Scissors Link

May I get some feedback please? I would like to ask what the expected output would be when threading over lines 28 to 32 of the img I shared. The first part of the answer I suspect will not throw off anyone: ‘The computer won!’ and this happens if the user === ‘scissors’ and computerChoice === ‘rock’. Specifically, I would like to know what is supposed to trigger the message ‘You won!’, in line 32?

Thanks in advance, lovely people!

It won’t be as simple as you have it written. There are three cases where the user (*) wins, and three where the computer (**) wins.

  *          **
user      computer
rock      scissors  *
scissors  paper     *
paper     rock      *
rock      paper     **
scissors  rock      **
paper     scissors  **

Thanks but that’s not quite what I was looking for. Specifically, I would like to know what is supposed to trigger the message ‘You won!’, in line 32? If usersChoice === ‘scissors’ and computerChoice === ‘rock’ outputs Computer Won! What will trigger the else statement: ‘You won?’
What does that input need to be?

The answer is in your if statements. Change ‘scissors’ to ‘paper’ for the user input.

I have to head over to work in a few minutes, but indeed that is what I have been trying and the code breaks when I invert the arguments exactly like you are specifying. I do not get the else statement that I expect as the output: ‘You won’ when I invert the arguments: (‘rock’ , ‘scissors’).
I plan on working on this some more tomorrow, and dedicating some more time to understanding this logic. Thank you for taking your time to reply, bud. If you do see anything that I am missing, I would appreciate any and all insight.

1 Like

D’oh! ‘scissors’ is in the outer if. My bad. Change user to ‘scissors’ and computer to ‘paper’.

You will need to write the other two conditionals in the same fashion as the first.

1 Like

You are darn cool, dude! You are right! The logic is the order in which the if statements appear. Thanks, Sir! Talk soon, tomorrow actually!

1 Like