Search:

Type: Posts; User: emilysk8

Search: Search took 0.18 seconds.

  1. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Not sure what this error means?
    The top part seems to be working now. Issues with the loop now. Here is the error. I can post the full code again if needed? Thought it's a couple threads above...
  2. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Thanks for your help & patience. I will get better at this.

    Got it, .equals compares, = assigns, what does == do? Does it compare outside of conditional branches?
    And yay! Computer is choosing!
    ...
  3. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    /*
    Rock Paper Scissors

    Emily Caraballo
    */

    import javax.swing.JOptionPane;
    import java.util.Random;

    public class RockPaperScissors
  4. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Gotcha! So using the JOptionPane to display computer choice, it displays nothing. I'm assuming there is nothing stored in the variable, then, right? So maybe some of this code is wrong??


    ...
  5. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Does System.out.println(...) work where I'm using the more visual JOptionPane ...?

    --- Update ---

    System.out.println isn't displaying anything. :(

    Here is all of the code.


    /*
  6. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Oops. Like this? From here, it cannot find the symbol, how do I let the user lose/win/tie, then enter a new variable for userChoice?


    //loop for gameQty
    for (int qty=gameQty;...
  7. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Thank you Cornix! Changed it to a for-loop, and .equals to compare. Program runs, but with a few issues:
    - Looping through more times than user enters.
    - I don't think the computer is choosing, or...
  8. Replies
    17
    Views
    1,631

    Re: Assigning random int to strings

    Oh my heck, sorry! Let me try this again. Editing my first post is just not going to happen.

    I think my loop is broken.


    while (gamesPlayed<gameQty)
    {
    userChoice =...
  9. Replies
    17
    Views
    1,631

    Assigning random int to strings

    .
Results 1 to 9 of 9