//Date: 3/17/2010
import java.util.Random;
public class Bingo
{
public static void main(String[] args)
{
Random bingo = new Random();
for (int i = 1; i <= 50; i++)
{
System.out.println("Card #" + i + "\n********");
System.out.println();
for (int j = 1; j <= 24; j++ )
{
int bingoNum;
bingoNum = bingo.nextInt(75);
System.out.print(" " + bingoNum);
}
System.out.println();
System.out.println();
}
}
}
Basically, I wanna place the 24 numbers on 5 rows, 5 columns, with the 3rd row/3rd column blank, just like a bingo card setup is.
How do I tell it to do a new line every 5th RANDOM number, plus a space in between the 2nd number and 4th number on the 3rd row, to look exactly like a bingo card?
As you see below, the output for the first 3 cards (out of 50) place all 24 random numbers (1-75) on the same line. Help??
Card #1
********
44 32 11 31 19 21 60 58 14 54 2 25 64 58 5 2 5 48 51 0 23 5 46 32
Card #2
********
19 50 7 54 39 4 55 72 6 40 26 65 8 11 10 6 58 62 34 65 48 5 72 28
Card #3
********
62 39 43 12 45 30 74 73 51 34 26 24 39 28 45 63 64 21 41 2 30 17 45 28