A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Zyi6

  • one year ago

JavaScript Help!!! Can someone help me out with if/else statements?

  • This Question is Closed
  1. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @dan815 @iambatman @Nnesha

  2. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I am trying to create a simple game of rock paper scissors. Can someone help?

  3. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Yes, yes we can

  4. tester97
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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?

  5. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @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?

  6. tester97
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  7. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Would you like this done through the js console, through a text box, or through a prompt and yes it is very easy -_-

  8. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    js console

  9. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    As of right now, I know that I need to start by declaring a function with 3 parameters, for rock, paper, and scissors, correct?

  10. tester97
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    var options = ["paper", "rock", "scissors"], result = [" ties ", " beats ", " loses to "], i = Math.floor(Math.random() * 3), randomChoice = options[i]

  11. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    ^you forgot some things there, like what loses/wins/ties... and also the input XD

  12. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    var options = function (rock, paper, scissors) {} Does that look like the correct starting point?

  13. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Hello?

  14. tester97
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Jay, I wasn't finish.

  15. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    oh ._.

  16. tester97
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I just wanted to know if she could build off of that.

  17. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    ohxD

  18. Zyi6
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I am a he, thank you very much.

  19. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    ._. #Awkward

  20. tester97
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    https://jsfiddle.net/DarkRiddles/3ym7erzg/

  21. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    ^O-o i didn't know about that website... *instantly bookmarks website*

  22. woodrow73
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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 ```

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

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.