Bingo Card Generator

Developer(s): Frank Terranella
Date: 1983
Type: Program
Platform(s): ZX81, TS 1000
Tags: Game

A bingo card generator. Each RUN prints a new card with five different numbers in each column, taken at random from 1 to 15 for B, 16 to 30 for I, and so on up to 75 for O, with XX in the free square. The numbers come from random slices of a string of all the numbers, so none repeats. Use COPY to print the card.

As printed, line 220 decides the column from the numbers left after one has been drawn, so now and then a number lands in the wrong column, usually when the lowest number left in its range is drawn last.

Published in Syntax December 1983 (Bingo Card Generator).

Related Articles

Short program to generate bingo cards.

Image Gallery

Source Code

  10 DIM A$(15,2)
  20 PRINT " B      I      N      G      O"
  30 PRINT AT 9,15;"XX"
  40 LET X$="010203040506070809101112131415"
  50 GOSUB 150
  60 LET X$="161718192021222324252627282930"
  70 GOSUB 150
  80 LET X$="313233343536373839404142434445"
  90 GOSUB 150
 100 LET X$="464748495051525354555657585960"
 110 GOSUB 150
 120 LET X$="616263646566676869707172737475"
 130 GOSUB 150
 140 STOP
 150 FOR X=1 TO 5
 160 LET R=(INT (RND*(16-X))+1)*2-1
 170 IF LEN X$=2 THEN LET A$(X)=X$
 180 IF LEN X$=2 THEN GOTO 210
 190 LET A$(X)=X$(R TO R+1)
 200 LET X$=X$( TO R-1)+X$(R+2 TO )
 210 IF VAL A$(X,1)=0 THEN LET A$(X)=A$(X,2)
 220 LET C=(1 AND X$(1)="0")+(8 AND X$(1)="1")+(15 AND X$(1)="3")+(22 AND X$(1)="4")+(29 AND X$(1)="6")
 230 IF C=15 AND X=3 THEN GOTO 250
 240 PRINT AT 3*X,C;A$(X)
 250 NEXT X
 260 RETURN

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.