System.out.prin tln ("Please Press 1 To Toss The Penny:");
for (int ab = 0; ab < 10; ab ++)
{
try
{
ans=input.nextI nt();
ans = 1;
int c = coll.nextInt(4) ;
int qwe = roww.nextInt(4) ;
System.out.prin t("[" + board[c][qwe] + "]");
}
catch (Exception e)
{
System.out.prin tln ("This Button is invalid");
}
}
i want to make it when user input 1 then it will give me a random number on my 2d array which i can do that already but when the user input anything beside 1 i want it be invalid and restart the loop wt it happen now is it will show me 10 time invalid
for (int ab = 0; ab < 10; ab ++)
{
try
{
ans=input.nextI nt();
ans = 1;
int c = coll.nextInt(4) ;
int qwe = roww.nextInt(4) ;
System.out.prin t("[" + board[c][qwe] + "]");
}
catch (Exception e)
{
System.out.prin tln ("This Button is invalid");
}
}
i want to make it when user input 1 then it will give me a random number on my 2d array which i can do that already but when the user input anything beside 1 i want it be invalid and restart the loop wt it happen now is it will show me 10 time invalid
Comment