import java.util.Scanner;
import java.util.Random;
public class test
{
public static void main(String[] args)
{
Random rand= new Random(); // being able to use random object
int[][] array = new int[3][9];
// print array in rectangular form
for (int i=0; i<array.length; i++)
{
for (int j=0; j<array[i].length; j++)
{
int k = rand.nextInt(9);
for(int x=0;x<5;x++)
{
array[i][k] = j*10 +rand.nextInt(10);
}
System.out.print("\t" + array[i][k]);
}
System.out.println("");
}
}
}
i need to create a bingo ticket.
it's supposed to create max 5 number per column but it is creating numbers for all the arrays.
i'm supposed to have a ticket like this
0 11 20 0 47 56 0 72 0
9 0 20 32 41 0 0 74 0
0 18 0 0 44 57 65 0 88
thx in advance