BTGBullseye
Master of Posts
Just on the off chance that someone into programming is interested in what can be done with as little as 100 lines of code, or possibly looking for inspiration, this is for you.
This is a program my father wrote in 1983 for a computer programming class. It plays bingo, and then lists how many balls were played before a bingo, as well as what the card numbers were for the winning card. It can play as many as 150 cards at a time quite easily. The inventiveness of this program (something his professor has never seen anyone come close to producing before or since) is that it plays the cards in a 3D stack instead of a 2D plane like most people would think to do. By doing this, he was able to reduce the size of the program down from over 1500 lines of code, to exactly 100 lines. If more programmers did this reduction of the program (reducing redundant code) with modern programs, we wouldn't need an 8-core i7 processor with top-of-the-line GPU to do VR or AR gaming at high framerates, or terrabyte drives to hold more than a half dozen games.
He did a test run of it for the class he was doing, and it took a total of 0.95 seconds to complete a run and play 4 cards to a bingo. When he first submitted it for grading, it was graded by a TA, and he got a 0. When he showed it to the professor and asked why it was failed, the professor took a closer look, and it resulted in a 100, a perfect A.
Here is a scan of the original printout from the class. (it excludes the last page, which is a duplicate of the first page, except the timestamps say "6.56.59")

Click to Enlarge
This is a program my father wrote in 1983 for a computer programming class. It plays bingo, and then lists how many balls were played before a bingo, as well as what the card numbers were for the winning card. It can play as many as 150 cards at a time quite easily. The inventiveness of this program (something his professor has never seen anyone come close to producing before or since) is that it plays the cards in a 3D stack instead of a 2D plane like most people would think to do. By doing this, he was able to reduce the size of the program down from over 1500 lines of code, to exactly 100 lines. If more programmers did this reduction of the program (reducing redundant code) with modern programs, we wouldn't need an 8-core i7 processor with top-of-the-line GPU to do VR or AR gaming at high framerates, or terrabyte drives to hold more than a half dozen games.
Code:
$JOB WATFIV
1 INTEGER BINGO (4,5,5), CARD, COL, ROW
2 INTEGER ARRAY (10), RANDOM, LAST, SEED /25/
3 INTEGER CAGE (50), PICK, STEPS (4), /0,0,0,0/
4 LOGICAL FOUND, DONE
5 DO 13 CARD=1,4
6 DO 12 ROW=1,5
7 DO 10 COL=1,10
8 ARRAY(COL)=COL+((ROW-1)*10)
9 10 CONTINUE
10 LAST=10
11 DO 11 COL=1,5
12 RANDOM=INT(URAND(SEED)*LAST)+1
13 BINGO(CARD,COL,ROW)=ARRAY(RANDOM)
14 ARRAY(RANDOM)=ARRAY(LAST)
15 LAST=LAST-1
16 11 CONTINUE
17 12 CONTINUE
18 BINGO(CARD,3,3)=0
19 13 CONTINUE
20 PRINT 91
21 EXECUTE LISTIT
22 80 DO 40 CARD=1,4
23 DONE=.FALSE.
24 DO 30 PICK=1,50
25 CAGE(PICK)=PICK
26 30 CONTINUE
27 LAST=50
28 WHILE (.NOT.DONE)
29 PICK=INT(URAND(SEED)*LAST)+1
30 EXECUTE MATCH
31 81 CAGE(PICK)=CAGE(LAST)
32 LAST=LAST-1
33 IF (LAST.LT.47) THEN
34 EXECUTE CHECK
35 83 END IF
36 84 FOUND=.FALSE.
37 END WHILE
38 PRINT 90
39 STEPS(CARD)=50-LAST
40 40 CONTINUE
41 EXECUTE LISTIT
42 PRINT 95,(STEPS(L),L=1,4)
43 PRINT 91
44 90 FORMAT('0')
45 91 FORMAT('1')
46 92 FORMAT(4(' B I N G O '))
47 93 FORMAT(4(' --------------------------'))
48 94 FORMAT(4(6X,'|',1X,I2,1X,'|',1X,I2,1X,'|'1X,I2,1X,'|',1X,I2,1X,'|',1X,I2,1X,'|'))
49 95 FORMAT(4(' BINGO IN ',I2,' STEPS '))
50 96 STOP
51 REMOTE BLOCK MATCH
52 DO 55 COL=1,5
53 DO 50 ROW=1,5
54 IF (CAGE(PICK).EQ.BINGO(CARD,COL,ROW)) THEN
55 BINGO(CARD,COL,ROW)=0
56 END IF
57 50 CONTINUE
58 55 CONTINUE
59 END BLOCK
60 REMOTE BLOCK CHECK
61 DO 101 ROW=1,5
62 DONE=.TRUE.
63 DO 100 COL=1,5
64 IF (BINGO(CARD,COL,ROW).NE.0) THEN
65 DONE=.FALSE.
66 END IF
67 100 CONTINUE
68 IF (DONE) THEN
69 QUIT3
70 END IF
71 101 CONTINUE
72 DO 111 COL=1,5
73 DONE=.TRUE.
74 DO 110 ROW=1,5
75 IF (BINGO(CARD,COL,ROW).NE.0) THEN
76 DONE=.FALSE.
77 END IF
78 110 CONTINUE
79 IF (DONE) THEN
80 QUIT3
81 END IF
82 111 CONTINUE
83 IF (BINGO(CARD,1,1).EQ.0.AND.BINGO(CARD,2,2).EQ.0.AND.BINGO(CARD,4,4).EQ.0.AND.BINGO(CARD,5,5).EQ.0) THEN
84 DONE=.TRUE.
85 END IF
86 IF (BINGO(CARD,5,1).EQ.0.AND.BINGO(CARD,4,2).EQ.0.AND.BINGO(CARD,2,4).EQ.0.AND.BINGO(CARD,1,5).EQ.0) THEN
87 DONE=.TRUE.
88 END IF
89 END BLOCK
90 REMOTE BLOCK LIST
91 PRINT 92
92 PRINT 90
93 PRINT 93
94 DO 20 COL=1,5
95 PRINT 94,((BINGO(CARD,COL,ROW),ROW=1,5),CARD=1,4)
96 PRINT 93
97 20 CONTINUE
98 PRINT 90
99 END BLOCK
100 END
C$END
C$ENTRY
Here is a scan of the original printout from the class. (it excludes the last page, which is a duplicate of the first page, except the timestamps say "6.56.59")

Click to Enlarge