Rock, scissors, paper

I have a question, or maybe my code is wrong.
My code is working properly, but I thought I was supposed to play against the computer, but there is no line of asking the user to input something. Is that the way it was supposed to be coded? I preloaded the strings needed, click on save and gives me different scenarios, however what was the point of using the mandatory .toLowerCase() for the input to be all in lower case or the invalid part if the user types anything other than rock, scissors, paper?

Thank you in advance for your help

One way to get input is to get a Window.prompt()

That’s a little bit limited though. Realistically you would write some html <form> with an <input> field so that you don’t have an annoying window prompt for every input.

If you’re just running the code without browser you’d have to do something like this which is also useful to know (but maybe better to bookmark for later).

1 Like

Oh, no wonder it was weird. Lol. I thought I was the one able to chose how to play. So by now and until I’m better, I’m just be happy with my code. Thank you again fr your input! That was twice, today!