A small program that picks a fortune at random from a list of eight. It ran on an IBM System/370 in 1972, fed through a card reader, output to a line printer. The same program has been rewritten here for each major era of personal computing, preserving the logic exactly. The control flow is identical in every version. What changes is everything around it: how you name things, how you structure a loop, how much the language trusts you, how much you have to ask permission.
Fifty-four years of progress and the core is still: seed a number, pick from a list, print the result. The machines got smaller. The languages got friendlier. The line count went down. But the idea — the actual thing the program does — hasn’t moved an inch. It’s tempting to draw a lesson from that. We won’t. The code speaks for itself.
1972 — FORTRAN IV / IBM System/370
Punched on 80-column cards. Column 1: C for comment. Column 6: continuation character. Columns 7–72: your program. Everything uppercase — no lowercase existed on the keypunch. No CHARACTER type, no PROGRAM statement. Strings live inside Hollerith constants in FORMAT statements. Branching happens with computed GO TO.
Hardware: IBM System/370 Model 155, 512K core memory, 2540 card reader, 1403 line printer. Compile with the FORTRAN G compiler. Run cost: approximately $4.50 in 1972 dollars, assuming you didn’t misplace a card.
C FORTUNE TELLER - IBM SYSTEM/370
C FORTRAN IV - G COMPILER
C PICKS ONE FORTUNE FROM A TABLE OF EIGHT
C
INTEGER IHOUR, IMIN, ISEC, IHS
INTEGER IRAND
C
C SEED FROM TIME-OF-DAY CLOCK
CALL TIME(IHOUR, IMIN, ISEC, IHS)
IRAND = MOD(ISEC * 13 + IHS, 8) + 1
C
C BRANCH TO SELECTED FORTUNE
GO TO (10,20,30,40,50,60,70,80), IRAND
C
10 WRITE(6,101)
101 FORMAT(1X, 38HTHE MACHINE KNOWS MORE THAN IT SAYS. )
GO TO 99
20 WRITE(6,102)
102 FORMAT(1X, 30HYOU WILL DEBUG BY MIDNIGHT. )
GO TO 99
30 WRITE(6,103)
103 FORMAT(1X, 38HA MISSING CARD WILL COST YOU DEARLY. )
GO TO 99
40 WRITE(6,104)
104 FORMAT(1X, 30HTHE NEXT RUN WILL SUCCEED. )
GO TO 99
50 WRITE(6,105)
105 FORMAT(1X, 22HTRUST THE CORE DUMP. )
GO TO 99
60 WRITE(6,106)
106 FORMAT(1X, 32HYOUR JCL IS FLAWLESS TODAY. )
GO TO 99
70 WRITE(6,107)
107 FORMAT(1X, 22HRESUBMIT AND HOPE. )
GO TO 99
80 WRITE(6,108)
108 FORMAT(1X, 40HTHE OPERATOR IS ON YOUR SIDE. PROBABLY. )
C
99 STOP
END
1982 — Applesoft BASIC / Apple II
No compiler. No cards. You type it in, you type RUN, it runs. Line numbers are the law. GOTO is not a suggestion.
10 REM ** FORTUNE TELLER **
20 DIM F$(8)
30 F$(1) = "THE MACHINE KNOWS MORE THAN IT SAYS."
40 F$(2) = "YOU WILL DEBUG BY MIDNIGHT."
50 F$(3) = "A MISSING DISK WILL COST YOU DEARLY."
60 F$(4) = "THE NEXT RUN WILL SUCCEED."
70 F$(5) = "TRUST THE ERROR MESSAGE."
80 F$(6) = "YOUR SYNTAX IS FLAWLESS TODAY."
90 F$(7) = "REBOOT AND HOPE."
100 F$(8) = "THE COMPUTER IS ON YOUR SIDE. PROBABLY."
110 N = INT(RND(1) * 8) + 1
120 PRINT F$(N)
1993 — QBasic / DOS 6.22
No line numbers required. Structured control flow. SUB and FUNCTION exist but nobody uses them for something this small. Runs instantly — no compile step, no waiting for the card reader, no $4.50.
' Fortune Teller - QBasic
RANDOMIZE TIMER
DIM fortune$(8)
fortune$(1) = "The machine knows more than it says."
fortune$(2) = "You will debug by midnight."
fortune$(3) = "A missing file will cost you dearly."
fortune$(4) = "The next build will succeed."
fortune$(5) = "Trust the stack trace."
fortune$(6) = "Your config is flawless today."
fortune$(7) = "Recompile and hope."
fortune$(8) = "The OS is on your side. Probably."
pick% = INT(RND * 8) + 1
PRINT fortune$(pick%)
2006 — Python 2.4
No DIM. No DATA. No line numbers. A list literal and a standard library call. The fortune array that took eight cards in 1972 is now one expression.
# fortune.py
import random
fortunes = [
"The machine knows more than it says.",
"You will debug by midnight.",
"A missing import will cost you dearly.",
"The next deploy will succeed.",
"Trust the traceback.",
"Your regex is flawless today.",
"Refactor and hope.",
"The framework is on your side. Probably.",
]
print random.choice(fortunes)
2026 — One Line, Any Terminal
shuf -n1 -e "The machine knows more than it says." "You will debug by midnight." "A missing dependency will cost you dearly." "The next push will succeed." "Trust the logs." "Your pipeline is flawless today." "Rollback and hope." "The cloud is on your side. Probably."
Curatorial note. The fortunes update with each era — cards become disks become files become dependencies — but the program doesn’t. Eight strings. One random index. One print statement. The computed GO TO becomes RND becomes random.choice becomes shuf. Everything else is dialect. The 1972 version needed a card reader, a line printer, and four dollars. The 2026 version needs a terminal. The distance between them is enormous and it is nothing at all.