what if i erase the comma?
here is the code:
Code:
import java.io.*;
public class Num2
{
public static void main(String[]args)throws IOException
{
BufferedReader a=new BufferedReader(new InputStreamReader(System.in));
int r1, c1, r2, c2;
int[][]cards;
cards=new int[4][4];
for(int r=0; r<4; r++)
{
for(int c=0; c<4; c++)
{
cards[r][c]=(int) (Math.random() * 8);
System.out.print(cards[r][c]);
}
System.out.print("\n");
}
for (int r=0; r<4; r++)
{
for (int c=0; c<4; c++)
{
System.out.print("*");
}
System.out.print("\n");
}
System.out.print("\nPlease insert the first card row and column.");
r1=Integer.parseInt(a.readLine());
c1=Integer.parseInt(a.readLine());
System.out.print("\nPlease insert the second card row and column.");
r2=Integer.parseInt(a.readLine());
c2=Integer.parseInt(a.readLine());
//reveal
for(int r=0; r<4; r++)
{
for (int c=0; c<4; c++)
{
if((r==r1)&&(c==c1))
{
System.out.print(cards[r][c]);
}
else if((r==r2)&&(c==c2))
{
System.out.print(cards[r][c]);
}
else
{
System.out.print("*");
}
System.out.println();
}
//match?
if (cards[r1][c1]==cards[r2][c2])
{
}
else
{
}
//this pushes the next board onto a blank screen
for (int b=0; b<=20; b++)
System.out.println();
}
}
}
it doesn't print any errors the problem is once the user enter their desired row and column,nothing happens..the number on the row and column they type didn't appear..waht's wrong?