Zyi6
  • Zyi6
JavaScript Help!!! Can someone help me out with if/else statements?
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Zyi6
  • Zyi6
@dan815 @iambatman @Nnesha
Zyi6
  • Zyi6
I am trying to create a simple game of rock paper scissors. Can someone help?
Jaynator495
  • Jaynator495
Yes, yes we can

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

tester97
  • tester97
No Offense, But this is so easy to do. 5 Year old could read a book and do this. Why are you taking a java course if you can't make a simple Rock, paper, and scissor game?
Zyi6
  • Zyi6
@Tester97, I am not taking a course. This is more of a hobby. I don't care if a 5 year old could do it, the point is that I'M the one that needs help. Now please, Help, or leave. @Jaynator495 , Will you help?
tester97
  • tester97
Zyi6, First off, if this was a hobby. You wouldn't be on a site that is poorly ran, and 80% of these people know nothing about programming. You are best off going to a real forum, and getting help.
Jaynator495
  • Jaynator495
Would you like this done through the js console, through a text box, or through a prompt and yes it is very easy -_-
Zyi6
  • Zyi6
js console
Zyi6
  • Zyi6
As of right now, I know that I need to start by declaring a function with 3 parameters, for rock, paper, and scissors, correct?
tester97
  • tester97
var options = ["paper", "rock", "scissors"], result = [" ties ", " beats ", " loses to "], i = Math.floor(Math.random() * 3), randomChoice = options[i]
Jaynator495
  • Jaynator495
^you forgot some things there, like what loses/wins/ties... and also the input XD
Zyi6
  • Zyi6
var options = function (rock, paper, scissors) {} Does that look like the correct starting point?
Zyi6
  • Zyi6
Hello?
tester97
  • tester97
Jay, I wasn't finish.
Jaynator495
  • Jaynator495
oh ._.
tester97
  • tester97
I just wanted to know if she could build off of that.
Jaynator495
  • Jaynator495
ohxD
Zyi6
  • Zyi6
I am a he, thank you very much.
Jaynator495
  • Jaynator495
._. #Awkward
tester97
  • tester97
https://jsfiddle.net/DarkRiddles/3ym7erzg/
Jaynator495
  • Jaynator495
^O-o i didn't know about that website... *instantly bookmarks website*
woodrow73
  • woodrow73
There are many ways to go about the same project - I find first making the algorithm then diving into the code works quite well. I'm not well versed in JS, but for rocks paper scissors (rps) I'd say ``` 1. user inputs their choice of r, p, or s 2. computer randomly picks it's choice 3. a function is called that takes the user's and computer's picks, and it figures out if user wins, loses, or it's a draw 4. result is displayed to the user ```

Looking for something else?

Not the answer you are looking for? Search for more explanations.