I'm trying to make a guessing game that I can log the number in from the keyboard. Then let random guess
my number,and continue until it finds the answer.A little Help will be great.
import java.util.Scanner; import java.util. Random; public class hellobaby { public static void main(String[] args, Scanner myScanner) { Scanner eyes =new Scanner(System.in); int kguess; kguess = eyes .nextInt(); System .out.println("input your number"+kguess); } boolean shouldLoopEnd = false;{ for (int counter=1;counter <=10;counter++); //generate a random number Random dice = new Random (); myScanner = dice.nextInt(6); System.out.println = ("The target number is: " + myScanner);} while (true) { int guessNumber = (int) (Math.random() * 100); System.out.println ("The loop guesses: " + guessNumber); if (guessNumber == guessNumber ) { shouldLoopEnd = true; } if (shouldLoopEnd == true) { System.out.println ("Woo hoo! We have a match!"); break; // break loop } else { //around the loop we go again System.out.println ("Let's try again.."); } } } } }