I am trying to make a guessing game that lies one-third of the time that the guess is too high (it says it is too low when it is actually too high). And it never lies about the guess being too low, nor does it lie twice in a row
This is my code but I don't know how to code the showUpdatedStatus() method
import javax.swing.JOptionPane;
public class Exercise4_28 extends BasicGame
{ private java.util.Random randy;
private int itsSecretNumber;
private int itsUsersNumber;
public Exercise4_28()
{ super();
randy = new java.util.Random();
}
public void askUsersFirstChoice()
{ itsSecretNumber = 1 + randy.nextInt (100);
askUsersNextChoice();
}
public void askUsersNextChoice()
{ String s = JOptionPane.showInputDialog
("Guess my number from 1 to 100:");
if (s != null && ! s.equals (""))
itsUsersNumber = Integer.parseInt (s);
else
itsUsersNumber = -1;
}
public boolean shouldContinue()
{ return itsUsersNumber != itsSecretNumber;
}
public void showUpdatedStatus()
{ Random chance = newRandom();
chance.nextInt(3);
if (chance == 1)
{ JOptionPane.showMessageDialog (null, "Hot");
}
else
{ JOptionPane.showMessageDialog (null, "Warm");
}
}
}