when the guess is the same as the dice roll and i enter yes again it only lets me enter the guess. then its asks me if i want to go again instead of running three rolls
--- Update ---
import javax.swing.JOptionPane;
public class Guess
{
public static void main(String args[])
{
int guess = 0;
int roll1 = 0;
int roll2 = 0;
String goAgain;
Roll game1 = new Roll(guess, roll1, roll2);
boolean hasWon = false;
do
{
guess = Integer.parseInt(JOptionPane.showInputDialog("Ente r the number that you hope to roll"));
JOptionPane.showMessageDialog(null, "Your guess was: " + guess);
game1.setDice1(roll1);
game1.setDice2(roll2);
for(int x = 1; x <= 3 && hasWon == false; x++)
{
if(game1.getAnswer() == guess)
{
JOptionPane.showMessageDialog(null, guess + "and " + game1.getAnswer() + " You WIN!!");
hasWon = true;
}
else
{
game1.setDice1(roll1);
game1.setDice2(roll2);
JOptionPane.showMessageDialog(null, game1.toString());
}
if(x == 3)
{
JOptionPane.showMessageDialog(null, "you lose");
}
}
goAgain = JOptionPane.showInputDialog("Would you like to play again?");
}while(goAgain.equalsIgnoreCase("Yes"));
}
}