How can i clear the screen after i choose to start a new game?
import cs1.Keyboard;
import java.util.*;
public class HiLo
{
public static void main (String[] args)
{
int play = 1;
while(play > 0)
{
Random generator = new Random();
int answer = generator.nextInt(100)+1;
//System.out.println(answer);
//int play = 1;
System.out.println("The computer is thinking of a number \nbetween 1 and 100. What is it?");
int escape = 0;
while(escape < 1)
{
int guess = Keyboard.readInt();
if(guess == answer)
{
System.out.println("That's it");
escape = 1;
}
else if(guess > answer)
{
System.out.println("Too High");
}
else if(guess < answer)
{
System.out.println("Too Low");
}
}
System.out.println("Would you like to play again (y/n)");
char again = Keyboard.readChar();
if(again == 'y')
{
play = 1;
}
else if(again == 'n')
{
play--;
}
}
}
}