# Bingo! Generate random numbers for Bingo cards.

Question asked by flybynight on Oct 23, 2013
Latest reply on Oct 24, 2013 by DavidJondreau

I've been tasked with a fun variable data print project. A client wants to produce 3000 custom "Bingo" cards with random number configurations.

My first thought is to turn to FileMaker to generate the numbers - the layout will be in InDesign and we can just "mail merge" the numbers together with the layout.

So, our standard Bingo rules apply - we need to fill a 5x5 grid with numbers (sans the "free space" in the middle).

Each column will have a range of possible numbers. B = 1-15, I = 16-30, N = 31-45, G = 46-60, O = 61-75.

The trick is that there can be no duplicate numbers in each record. You can't have 2 B-7's, on one card, for example.

Is it as easy as having my fields be calculations (or auto-enter calcs) and can I then have some sort of validation that says the field B1 ≠ B2, B3, B4 or B5?

Or do I have to build each record with a script, have it go to the first field (B1) set it to a random number with the formula:

1 + (Int(Random * 15)

…then move to field B2, set it with the same formula, but then use a loop to check if B2 = B1, re-generate the number for B2 until it is unique.

…repeat for B3, B4 and B5.

Then move on to I1 and do the same, except change the formula to:

16 + (Int(Random * 15)

If it could all be done with field-level validation, then all I would have to do is create 3000 records and… Bingo, I'm done. If not, then I'll have to do it with the script method.

According to Wikipedia, there are 552 Septillion (that's 24 zeros!) possibilities, so I'm assuming FMP's random should be good enough to not generate any duplicate records over 3,000. I guess it would be easy enough to have a concatenated field with unique validation, but probably not necessary.

Or if anyone has a better idea, I'm all ears.

I did some searching on the net and this forum and didn't find the same thing. Several sites that can generate Bingo cards, but I'm just looking for the raw numbers to put into my own layout. If that does exist already, why re-invent the wheel.

Laters,

-Shawn