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...
Type: Posts; User: emilysk8
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...
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!
...
/*
Rock Paper Scissors
Emily Caraballo
*/
import javax.swing.JOptionPane;
import java.util.Random;
public class RockPaperScissors
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??
...
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.
/*
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;...
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...
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 =...