Category Archives: BASIC Games

Tunnels & Traps: A Tiny BASIC Game

Back in 1980, I created a computer game for my TRS-80 Pocket Computer, inspired by Tunnels & Trolls. Given the passing of Rick Loomis, I thought I would dig it out.

As with T&T, I had attributes: ST (Strength), DX (Dexterity), and CN (Constitution, used for hit points). But I skipped LK (Luck) and CH (Charisma), and I used D&D’s WS (Wisdom) instead of T&T’s IQ (Intelligence). Like T&T, and unlike D&D, attributes could increase: in my case, quickly, after every monster, rolling three dice and if the total exceeds an attribute you can increase that attribute; if it doesn’t exceed any attribute, take that amount in gold instead. Powerful characters would gain wealth, while weaker characters would gain power. Unlike in T&T, attributes couldn’t increase past 18, though.

Combat was different. As with T&T, monsters had one number (this MR was based on how deep and how far you were in the dungeon), which was used for all their attributes (CN=3*MR, ST=3*MR, etc.). But missile attacks (F for FIRE, using DX plus a bonus for level deep) lost effectiveness after the first round, melee attacks (A for ATTACK, using ST) quickly lost effectiveness during an encounter, and spell attacks (C for CAST SPELL, using WS) gradually lost effectiveness. If you rolled under your attribute score (on 3 dice), you doubled your result, so better attributes minimized your downside. Your result was compared to the monster’s, and the difference was the damage and determined who it was dealt to (a difference of 0 harmed no one). After killing a monster, you could heal up to the monster’s level, providing the incentive for attacking tougher monsters.

Saving rolls were different too: they were done on three dice instead of two, with no cascading rolls in case of doubles. You had to roll under your attribute to succeed. A wisdom saving roll is needed when looking for traps, and a dexterity saving roll when jumping away from triggered traps or for parrying an attack when fleeing a monster.

A last shout-out to T&T: the troll was the toughest monster!

The Pocket Computer would only display 24 characters at a time. After a PRINT statement, you’d hit a key to see the next PRINT statement.

Screencap from a YouTube video

The Pocket Computer had a Tiny BASIC that lacked the ELSE statement (a common omission), but also RND, DATA, READ, and RESTORE. However, unlike TRS-80 Level I BASIC (my first programming language), which only had two string variables (up to 16 characters each), the PC-1 had 26 string variables of 7 characters each – sort of. They were actually an overlay over the 26 numeric variables: if you used A$, you couldn’t use A (numeric variable), and so forth. Also the array A() would alias these variables: A(1) was the same as A, A(2) was B, etc.

The PC-1 only had 1,425 bytes of RAM available for programming, and I must have hit that limit because my TRS-80 Level II BASIC listing had longer text descriptions and an additional command.

The goal is to collect the most gold. Commands:

  • Attack with a sword (uses ST)
  • Cast spell (uses WS)
  • Fire missile (uses DX)
  • Traps? (detects a trap in an empty room using WS)
  • Inventory (shows your attributes)
  • North
  • South
  • East
  • West
  • Up
  • Down

You can play Tunnels & Traps with Joshua Bell’s great Applesoft BASIC emulator. Copy and paste the following code, modified a bit to work there:

1 DIM A(26):GOTO 7
3 D=0:FOR I=1TO 3:R=23*R:R=R-32767*INT(R/32767):D=D+R-6*INT(R/6)+1:NEXT :RETURN 
5 PRINT "ST"; S; " DX"; F; " WS"; W; " CN"; C; " GD"; G:RETURN 
6 GOTO 30
7 PRINT "TUNNELS & TRAPS":INPUT "EXPLORE TUNNEL #?";N:R=N
8 GOSUB 3:S=D:GOSUB 3:F=D:GOSUB 3:W=D:GOSUB 3:C=D:G=0:GOSUB 5
9 PRINT:INPUT "COMMAND?";A$:GOSUB 3:GOSUB 10:GOTO 9
10 IF A$="A" THEN T=S-E:PRINT "SWORD";:GOTO 76
12 IF A$="C" THEN T=W-E/3:PRINT "SPELL";:GOTO 76
13 IF A$="D" THEN Z=Z-1:GOTO 6
14 IF A$="E" THEN X=X+1:GOTO 6
15 IF A$="F" THEN T=(F+L)*(E=0):PRINT "ARROW";:GOTO 76
18 IF A$="I" GOTO 5
20 IF A$="N" THEN Y=Y-1:GOTO 6
22 IF A$="S" THEN Y=Y+1:GOTO 6
23 IF A$="T" THEN T=W:GOTO 62
24 IF A$="U" THEN Z=Z+1:GOTO 6
26 IF A$="W" THEN X=X-1:GOTO 6
28 PRINT "NOR SOU EAST WEST UP DN":PRINT "ATTK CAST FIRE INV TRPS?":RETURN
30 IF M<0THEN GOSUB 62
31 IF M>0THEN A$="X":PRINT "PARRY";:T=W:GOSUB 80
32 L=INT((ABS(X)+ABS(Y)+3*ABS(Z))/3)+1:M=0:GOSUB 3:IF D>7 THEN M=L:REM
38 IF D<5 THEN PRINT "TRAP";:T=F:M=-L
40 IF M=0 THEN PRINT "NOTHING";
41 IF D<7 THEN M=-L
42 IF M=1 THEN PRINT "IMP";
44 IF M=2 THEN PRINT "KOBOLD";
46 IF M=3 THEN PRINT "GOBLIN";
48 IF M=4 THEN PRINT "HOBGOBLIN";
50 IF M=5 THEN PRINT "ORC";
52 IF M=6 THEN PRINT "HALFORC";
54 IF M=7 THEN PRINT "OGRE";
56 IF M>7 THEN PRINT "TROLL";
58 PRINT " HERE!"
60 IF D>4 THEN RETURN 
62 GOSUB 3:IF (D<T)AND(M<0) THEN PRINT "YOU JUST ESCAPE A TRAP!":M=0:RETURN
64 IF M>=0 THEN PRINT "NO TRAP DETECTED.":RETURN 
66 GOSUB 3:IF A$="T"THEN D=INT(D/2)
68 IF D>L THEN D=L
70 IF D>C THEN D=C-1
72 C=C-D:PRINT "A TRAP CAUSED ";D;" DAMAGE.":RETURN 
76 E=E+1:IF M<=0 THEN PRINT "S ARE USELESS HERE!":RETURN 
78 GOSUB 3:IF D<T THEN D=D+D
80 P=D:GOSUB 3:IF D<L*2 THEN D=D+D
82 IF P>=D AND A$<>"X" THEN M=M-(P-D)/3:PRINT " HIT FOR ";P-D;" DAMAGE."
83 IF P>=D AND A$="X" THEN PRINT " SUCCEEDED."
84 IF P<D THEN C=C+P-D:PRINT " MISSED.":PRINT "YOU TOOK ";D-P;" DAMAGE."
86 IF C<1 THEN PRINT "YOU DIED IN TUNNEL ";N;"!":GOSUB 5:PRINT:END 
88 IF M>0 THEN RETURN 
90 PRINT "YOU KILLED IT!":M=0:E=0
91 GOSUB 3:PRINT "ROLL OF ";D;": ";:IF C<L THEN C=L:IF C>18 THEN C=18
92 IF (D<=S)AND(D<=F)AND(D<=W)THEN G=G+D:PRINT "GOLD!":GOTO 5
93 T=23:A(6)=F:A(19)=S:A(23)=W
94 IF (S>=F)AND(S>=W)THEN T=19:U=23:V=6:IF (F>=W)THEN U=6: V=23
95 IF (F>S)AND(F>=W)THEN T=6:U=23:V=19:IF (S>=W)THEN U=19: V=23
96 IF (W>S)AND(W>F)THEN T=23:U=6:V=19:IF (S>=F)THEN U=19: V=6
97 IF D>A(T)THEN GOTO 195
98 IF D>A(U)THEN T=U:GOTO 195
99 T=V
195 IF (T=6)THEN F=F+1:PRINT "DEXTERITY!":GOTO 5
196 IF (T=19)THEN S=S+1:PRINT "STRENGTH!":GOTO 5
197 IF (T=23)THEN W=W+1:PRINT "WISDOM!":GOTO 5
198 GOTO 5

And below is the PC-1 source code. You’ll have to forgive the lack of comments. There wasn’t sufficient memory to have any! And it is spaghetti code, inspired by assembly language: the common subroutines had one-digit line numbers that jumped down because every byte counted, and RETURN took less space than GOTO 9. The whole thing later got much further developed in the comparative luxury of 16KB RAM on the TRS-80 Model I Level 2. But that’s a post for another day.

  1:GOTO 7
  3:D=0:FOR I=1TO 3:R=23*R:R=R-32767*INT(R/32767):D=D+INT(R/6)+1:NEXT :RETURN 
  5:PRINT "ST";S;" DX";F;" WS";W;" CN";C;" GD";G:RETURN 
  6:GOTO 30
  7:INPUT "TUNNEL #?";N:R=N
  8:GOSUB 3:S=D:GOSUB 3:F=D:GOSUB 3:W=D:GOSUB 3:C=D:GOSUB 5
  9:INPUT A$:GOSUB 3:GOSUB 10:GOTO 9
 10:IF A$="A"THEN T=S-E:PRINT "SWORD";:GOTO 76
 12:IF A$="C"THEN T=W-E/2:PRINT "SPELL";:GOTO 76
 13:IF A$="D"THEN Z=Z-1:GOTO 6
 14:IF A$="E"THEN X=X+1:GOTO 6
 15:IF A$="F"THEN T=F*(E=0):PRINT "ARROW";:GOTO 76
 20:IF A$="N"THEN Y=Y-1:GOTO 6
 22:IF A$="S"THEN Y=Y+1:GOTO 6
 23:IF A$="T"THEN T=W:GOTO 62
 24:IF A$="U"THEN Z=Z+1:GOTO 6
 26:IF A$="W"THEN X=X-1:GOTO 6
 28:RETURN 
 30:IF M<0GOSUB 62
 31:IF M>0THEN A$="X":PRINT "PARRY";:T=F:GOSUB 80
 32:L=INT((ABS X+ABS Y+ABS Z)/3):M=0:GOSUB 3:IF D>8THEN M=L
 38:IF D<5THEN PRINT "TRAP";:T=F:M=-L
 40:IF M=0THEN PRINT "NOTHING";
 41:IF D<7THEN M=-L
 42:IF M=1PRINT "IMP";
 44:IF M=2PRINT "KOBOLD";
 46:IF M=3PRINT "GOBLIN";
 48:IF M=4PRINT "HOBGOBLIN";
 50:IF M=5PRINT "ORC";
 52:IF M=6PRINT "HALFORC";
 54:IF M=7PRINT "OGRE";
 56:IF M>7PRINT "TROLL";
 58:PRINT " HERE!"
 60:IF D>4 RETURN 
 62:GOSUB 3:IF (D<T)*(M<0)PRINT "YOU ESCAPE TRAP!":M=0:RETURN 
 64:IF M>=0PRINT "NOT FOUND":RETURN 
 66:GOSUB 3:IF A$="T"THEN D=INT(D/2)
 68:IF D>LTHEN D=L
 70:IF D>CTHEN D=C-1
 72:C=C-D:PRINT "TRAP HIT FOR ";D;".":RETURN 
 75:E=E+1:IF M<=0PRINT "S USELESS HERE!":RETURN 
 77:GOSUB 3:IF D<TTHEN D=D+D
 79:P=D:GOSUB 3:IF D<L*2THEN D=D+D
 81:IF (P>=D)*(A$<>"X")THEN M=M-(P-D)/3:PRINT " HIT FOR ";P-D;"."
 83:IF (P>=D)*(A$="X")PRINT "!"
 84:IF P<DTHEN C=C+P-D:PRINT " MISSED":PRINT "YOU TOOK ";D-P;" HITS."
 86:IF C<1PRINT "YOU DIED!":GOSUB 5:END 
 88:IF M>0RETURN 
 90:PRINT "YOU SLEW IT!":M=0:E=0
 91:GOSUB 3:PRINT "ROLL OF ";D;":";:IF C<LTHEN C=L:IF C>18THEN C=18
 92:IF (D<=S)*(D<=F)*(D<=W)THEN G=G+D:PRINT "GD!":GOTO 5
 93:IF (S>=F)*(S>=W)THEN T=19:U=23:V=6:IF (F>=W)THEN U=6:V=23
 94:IF (F>S)*(F>=W)THEN T=6:U=23:V=19:IF (S>=W)THEN U=19:V=23
 95:IF (W>S)*(W>F)THEN T=23:U=6:V=19:IF (S>=F)THEN U=19:V=6
 96:IF D>A(T)GOTO 99
 97:IF D>A(U)THEN T=U:GOTO 99
 98:T=V
 99:A(T)=A(T)+1:IF (T=6)PRINT "DX!"
100:IF (T=19)PRINT "ST!"
101:IF (T=23)PRINT "WS!"
102:GOTO 5

Printouts as Games

As we discussed last time, while BASIC Computer Games became a bestseller because of microcomputers, the games themselves dated back to timesharing systems using teletypewriters. As a result, a few of this first generation of BASIC games produced printed output as the primary purpose or as the game itself.

The most game-like of these was Amazing, which would generate a new, random maze that you could solve on the printout.

AMAZING PROGRAM

CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY

WHAT ARE YOUR WIDTH AND LENGTH? 10
??? 10

.--.--.--.  .--.--.--.--.--.--.
I        I              I     I
:--:--:  :--:--:  :  :  :  :  .
I        I        I  I     I  I
:  :--:--:  :  :--:  :--:--:  .
I  I        I     I  I     I  I
:  :  :--:--:--:--:  :  :  :  .
I  I     I        I  I  I     I
:  :  :--:  :  :  :  :--:  :--.
I  I  I     I  I  I     I     I
:  :  :  :--:  :  :--:  :--:  .
I     I  I     I        I  I  I
:--:--:  :--:--:--:--:  :  :  .
I              I     I  I     I
:  :--:--:  :  :  :  :--:--:--.
I        I  I     I           I
:  :--:  :--:--:--:--:--:--:  .
I     I  I        I        I  I
:--:  :  :  :--:  :  :--:  :  .
I     I  I     I        I     I
:--:--:  :--:--:--:--:--:--:--.

The Banner program would print a headline:

HORIZONTAL? 1
VERTICAL? 1
CENTERED? N
CHARACTER (TYPE 'ALL' IF YOU WANT CHARACTER BEING PRINTED)? ALL
STATEMENT?? BASIC
SET PAGE? 1

BBBBBBBBB
B   B   B
B   B   B
B   B   B
B   B   B
B   B   B
BBB BBB

 

AAAAAA
A  A
A   A
A    A
A   A
A  A
AAAAAA


 
S   S
S   S S
S   S   S
S   S   S
S   S   S
S S   S
S   S

 

I       I
I       I
I       I
IIIIIIIII
I       I
I       I
I       I
 
 

CCCCC
C     C
C       C
C       C
C       C
C     C
C   C

And, finally, Calendar would produce a calendar; hardcoded for 1979.

CALENDAR
CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY
 
** 0  ****************** JANUARY ****************** 365 **
 
S       M       T       W       T       F       S
 
***********************************************************
 

2       3       4       5       6       7       8
 

9       10      11      12      13      14      15
 

16      17      18      19      20      21      22

 
23      24      25      26      27      28      29
 

30      31


** 31 ****************** FEBRUARY****************** 334 **

S       M       T       W       T       F       S

***********************************************************


1       2       3       4       5
 

6       7       8       9       10      11      12


13      14      15      16      17      18      19
 

20      21      22      23      24      25      26
 

27      28

 

** 59 ******************  MARCH  ****************** 306 **

S       M       T       W       T       F       S

***********************************************************
 

1       2       3       4       5
 

6       7       8       9       10      11      12
 

13     14      15      16      17      18      19
 

20     21      22      23      24      25      26
 

27     28      29      30      31
 

** 90 ******************  APRIL  ****************** 275 **

S       M       T       W       T       F       S

***********************************************************


1       2
 

3       4       5       6       7       8       9
 

10      11      12      13      14      15      16


17      18      19      20      21      22      23
 

24      25      26      27      28      29      30

 
** 120 ******************   MAY   ****************** 245 **

S       M       T       W       T       F       S

***********************************************************
 

1       2       3       4       5       6       7


8       9       10      11      12      13      14
 

15      16      17      18      19      20      21
 

22      23      24      25      26      27      28
 

29      30      31


** 151 ******************   JUNE  ****************** 214 **

S       M       T       W       T       F       S

***********************************************************
 

1       2       3       4
 

5       6       7       8       9       10      11
 

12      13      14      15      16      17      18
 

19      20      21      22      23      24      25
 

26      27      28      29      30


** 181 ******************   JULY  ****************** 184 **

S       M       T       W       T       F       S

***********************************************************


1       2


3       4       5       6       7       8       9
 

10      11      12      13      14      15      16
 

17      18      19      20      21      22      23
 

24      25      26      27      28      29      30
 

31


** 212 ******************  AUGUST ****************** 153 **

S       M       T       W       T       F       S

***********************************************************


1       2       3       4       5       6


7       8       9       10      11      12      13
 

14      15      16      17      18      19      20
 

21      22      23      24      25      26      27
 

28      29      30      31
 

** 243 ******************SEPTEMBER****************** 122 **

S       M       T       W       T       F       S

***********************************************************
 

1       2       3
 

4       5       6       7       8       9       10
 

11      12      13      14      15      16      17
 
18      19      20      21      22      23      24
 

25      26      27      28      29      30
 

** 273 ****************** OCTOBER ****************** 92 **

S       M       T       W       T       F       S

***********************************************************
 

1
 

2       3       4       5       6       7       8
 

9       10      11      12      13      14      15
 

16      17      18      19      20      21      22
 

23      24      25      26      27      28      29
 

30      31
 

** 304 ****************** NOVEMBER****************** 61 **

S       M       T       W       T       F       S

***********************************************************


1       2       3       4       5

 
6       7       8       9       10      11      12


13      14      15      16      17      18      19
 

20      21      22      23      24      25      26
 

27      28      29      30


** 334 ****************** DECEMBER****************** 31 **

S       M       T       W       T       F       S

***********************************************************
 

1       2       3
 

4       5       6       7       8       9       10
 

11      12      13      14      15      16      17
 

18      19      20      21      22      23      24


25      26      27      28      29      30      31


You can give each of these a spin in this BASIC emulator (every program from BASIC Computer Games can be preloaded from the dropdown menu). Next time, we’ll look at the primitive visualization tools that were packaged as “games”.

History of Game Art: Timeshare BASIC Edition

When I first met Rick Dakan, one of the creators of City of Heroes, we talked about a class he’s teaching at Ringling College of Art and Design in the spring, “The History of Game Art.” The class starts with Spacewar! in 1962 but to my surprise doesn’t cover some of the BASIC games of the timeshare era (circa 1964 to 1976). Yes, some have “art” (in fact, some are only art).

BASIC Computer Games, the first computer book to sell a million copies, is thought of as a collection of microcomputer games. And while the games were edited to run in Microsoft Altair 8K BASIC, almost all of the games were ports of games created on timeshare systems. In fact, many of the games were played by teletype and so produced printed output, output that could be preserved, as art. In fact, the output from some of the examples below was too large to even display completely on one screen on a typical 1970s microcomputer, as you’ll find out for yourself in the emulator.

Here are four examples, all of which you can “play” in your browser. Click the Show output button to have a virtual printout. While these are listed as “Computer Games” they aren’t computer games in any modern sense – diversions, maybe.

Bunny provides an image of a rabbit using the text “BUNNY”.

                                BUNNY
              CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY

UN
BUN                                         BUNNYB
BUNNYB                                    NYBUNNYBUN
BUNNYBUN                                UNNYBUNNYBUN
UNNYBUNNY                           NNYBUNNYBUNNYB
 NNYBUNNYBU                        UNNYBUNNYBUNNYB
  NYBUNNYBUNN                    YBUNNYBUNNYBUNNY
   YBUNNYBUNNY                 NNYBUNNYBUNNYBUNN
    BUNNYBUNNYB               UNNYBUNNYBUNNYBUN
     UNNYBUNNYBU             BUNNYBUNNYBUNNYB
      NNYBUNNYBUN           YBUNNYBUNNYBUNNY
       NYBUNNYBUNNY        NYBUNNYBUNNYBUNN
        YBUNNYBUNNYB      NNYBUNNYBUNNYBU
         BUNNYBUNNYBU    UNNYBUNNYBUNNYB
          UNNYBUNNYBUN  BUNNYBUNNYBUNN
           NNYBUNNYBUN YBUNNYBUNNYBU
            NYBUNNYBUNNYBUNNYBUNNY
             YBUNNYBUNNYBUNNYBUNN
              BUNNYBUNNYBUNNYBU
                NNYBUNNYBUNNY
                 NYBUNNYBUN
                  YBUNNYBU
               UNNYBUNNYBUNN
            NYBUNNYBUNNYBUNNYB
          UNNYBUNNYBUNNYBUNNYBU
         BUNNYBUNNYBUNNYBUNNYBUN
       NYBUNNYBUNNYBUNNYBUNNYBUNN
      NNYBUNNYBUNNYBUNNYBUNNYBUNNY
     UNNYBUNN  UNNYBUNNYBUNNYBUNNY
    BUNNYBUN   UNNYBUNNYBUNNYBUNNYB
   YBUNNYBUN   UNNYBUNNYBUNNYBUNNYB
  NYBUNNYBUN  BUNNYBUNNYBUNNYBUNNYB
 NNYBUNNYBUNNYBUNNYBUNNYBUNNYBUNNYB
UNNYBUNNYBUNNYBUNNYBUNNYBUNNYBUNNYB
 NNYBUNNYBUNNYBUNNYBUNNYBUNNYBUNNY
  NYBUNNYBUNNYBUNNYBUNNYBUNNYBUNNY
   YBUNNYBUNNYBUNNYBUNNYBUNNYBUNN
     UNNYBUNNYBUNNYBUNNYBUNNYBUNN
         BUNNYBUNNYBUNNYBUNNYBUN Y
             YBUN YBUNNYB  NYBU   B
              BUNNY   NYBUNNYB     U
             YBUNN  U  YBUNNYB      N
            NYBUNN    NYBUNNY   NYBUNN
           NNYBUNNYBUNNYBUNNY UNN
          UNN   N Y  N YBUNNYBU
         BU     NN   N Y    Y
                     NN  UNNY
                          NNY
                           NY

That’s it. The user can’t even change the text. There is literally no interactivity. This isn’t even sophisticated ASCII art, where letters are chosen for gradients or contrasts. It’s just the word “BUNNY” in a “BUNNY” shape. Yet Ahl elected to include this program in both 101 BASIC Computer Games, published in 1975 with games for timeshare systems, and its successor, published in 1978.

Diamonds introduces a sliver of interactivity. You can specify one of nine different widths of diamonds.

                               DIAMOND
              CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY

FOR A PRETTY DIAMOND PATTERN,
TYPE IN AN ODD NUMBER BETWEEN 5 AND 21? 15
      C              C              C              C
     CC!            CC!            CC!            CC!
    CC!!!          CC!!!          CC!!!          CC!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
    CC!!!          CC!!!          CC!!!          CC!!!
     CC!            CC!            CC!            CC!
      C              C              C              C
      C              C              C              C
     CC!            CC!            CC!            CC!
    CC!!!          CC!!!          CC!!!          CC!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
    CC!!!          CC!!!          CC!!!          CC!!!
     CC!            CC!            CC!            CC!
      C              C              C              C
      C              C              C              C
     CC!            CC!            CC!            CC!
    CC!!!          CC!!!          CC!!!          CC!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
    CC!!!          CC!!!          CC!!!          CC!!!
     CC!            CC!            CC!            CC!
      C              C              C              C
      C              C              C              C
     CC!            CC!            CC!            CC!
    CC!!!          CC!!!          CC!!!          CC!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!CC!!!!!!!!!!!!!
CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!  CC!!!!!!!!!!!
 CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!    CC!!!!!!!!!
  CC!!!!!!!      CC!!!!!!!      CC!!!!!!!      CC!!!!!!!
   CC!!!!!        CC!!!!!        CC!!!!!        CC!!!!!
    CC!!!          CC!!!          CC!!!          CC!!!
     CC!            CC!            CC!            CC!
      C              C              C              C

Love is the most artistic selection of these programs.

                                LOVE
              CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY



A TRIBUTE TO THE GREAT AMERICAN ARTIST, ROBERT INDIANA.
HIS GREATEST WORK WILL BE REPRODUCED WITH A MESSAGE OF
YOUR CHOICE UP TO 60 CHARACTERS.  IF YOU CAN'T THINK OF
A MESSAGE, SIMPLE TYPE THE WORD 'LOVE'

YOUR MESSAGE, PLEASE? LOVE IS ALL YOU NEED











LOVE IS ALL YOU NEEDLOVE IS ALL YOU NEEDLOVE IS ALL YOU NEED
L            OU NEEDLOVE IS ALL YOU NEE         ALL YOU NEED
LOV         YOU NEEDLOVE IS ALL YOU                 YOU NEED
LOVE      L YOU NEEDLOVE IS ALL Y                     U NEED
LOVE      L YOU NEEDLOVE IS ALL              IS A       NEED
LOVE      L YOU NEEDLOVE IS ALL           VE IS AL      NEED
LOVE      L YOU NEEDLOVE IS ALL          OVE IS ALL     NEED
LOVE      L YOU NEEDLOVE IS ALL         LOVE IS ALL     NEED
LOVE      L YOU NEEDLOVE IS ALL        DLOVE IS AL      NEED
LOVE      L YOU NEEDLOVE IS ALL       EDLOVE IS A       NEED
LOVE      L YOU NEEDLOVE IS ALL      EEDLOVE IS         NEED
LOVE      L YOU NEEDLOVE IS A L     NEEDLOVE IS         NEED
LOVE      L YOU NEEDLOVE IS A L     NEEDLOVE I          NEED
LOVE      L YOU NEEDLOVE IS   L      EEDLOVE            NEED
LOVE      L YOU NEEDLOVE IS   L       EDLOV             NEED
LOVE      L YOU NEEDLOVE      L                         NEED
L                             L YOU                 YOU NEED
L                             L YOU NEE         ALL YOU NEED
L             U NEE                                        D
L             U NEE                                        D
LOVE      L YOU NEEDLOV   S ALL YOU       VE IS ALL YO     D
LOVE        YOU NEEDLO   IS ALL YOU       VE IS ALL YOU    D
LOVE        YOU NEEDLO   IS ALL YOU       VE IS ALL YOU N  D
LOVE I      YOU NEEDL    IS ALL YOU       VE IS ALL YOU NE D
LOVE I      YOU NEEDL    IS ALL YOU       VE IS A L YOU NEED
LOVE IS      OU NEED   E IS ALL YOU       VE IS   L YOU NEED
LOVE IS      OU NEED   E IS ALL YOU               L YOU NEED
LOVE IS       U NEE   VE IS ALL YOU       VE IS   L YOU NEED
LOVE IS       U NEE   VE IS ALL YOU       VE IS A L YOU NEED
LOVE IS A       NE   OVE IS ALL YOU       VE IS ALL YOU NE D
LOVE IS A       NE   OVE IS ALL YOU       VE IS ALL YOU N  D
LOVE IS AL      N   LOVE IS ALL YOU       VE IS ALL YOU    D
LOVE IS AL          LOVE IS ALL YOU       VE IS ALL YO     D
LOVE IS ALL        DLOVE IS ALL                            D
LOVE IS ALL        DLOVE IS ALL                            D
LOVE IS ALL YOU NEEDLOVE IS ALL YOU NEEDLOVE IS ALL YOU NEED

Finally, Bug is an implementation of The Game of Cootie. And is as little a game as its inspiration: the computer rolls for you, and if you get a new body part of the bug, adds it to your bug, otherwise nothing happens on your turn. You race the computer. All you can do is type “Y” or “N” to decide whether you want to see the illustrations as you go. Here’s an example of the end game:

I ROLLED A 6 
6=LEGS
I NOW HAVE 6 LEGS.
MY BUG IS FINISHED.
DO YOU WANT THE PICTURES?? Y
*****YOUR BUG*****


         A A 
         A A 
         A A 
         A A 
        HHHHHHH
        H     H
        H O O H
        H     H
        H  V  H
        HHHHHHH
          N N
          N N
     BBBBBBBBBBBB
     B          B
     B          B
TTTTTB          B
     BBBBBBBBBBBB
     L L L L L
     L L L L L




*****MY BUG*****



         F F 
         F F 
         F F 
         F F 
        HHHHHHH
        H     H
        H O O H
        H     H
        H  V  H
        HHHHHHH
          N N
          N N
     BBBBBBBBBBBB
     B          B
     B          B
TTTTTB          B
     BBBBBBBBBBBB
     L L L L L L
     L L L L L L
I HOPE YOU ENJOYED THE GAME, PLAY IT AGAIN SOON!!

Arguably the most famous BASIC game of the timeshare era is Star Trek. It starts with an illustration:

                                    ,------*------,
                    ,-------------   '---  ------'
                     '-------- --'      / /
                         ,---' '-------/ /--,
                          '----------------'

                    THE USS ENTERPRISE --- NCC-1701

One program Ahl did omit from the revised edition was the misogynistic UGLY (page 228): “This program draws on the terminal the profile of a woman. It gives you an opportunity to specify the ‘dimensions’ of your woman (termed SPECIAL) or take your chances (CHANCE). The computer draws your figure and then makes a determination whether or not to call your woman ugly or just leave it up to your own judgement.” A wise omission.

Another omission from the original wasn’t even a program. It was simply ASCII art:

(I have fond memories of visiting my dad at work in the 1970s and seeing the mainframe room. One of the techs gave me an ASCII-art Snoopy calendar.)

Clearly art in computer games has come a long way from these modest beginnings. But since I’m mainly interested in the history of BASIC, in future posts, I’ll look at more practical printed output from these “games” and then separately at some of the primitive visualization tools that were included.

Play BASIC Computer Games Online

I was surprised that there was no easy way to play David Ahl’s classic book, BASIC Computer Games, in your browser. You can now play them here:

Play BASIC Computer Games in Your Browser

BASIC Computer Games sold over a million copies as microcomputer users in the 1970s and early 1980s typed its programs into their Commodore PETs, Apple IIs, and TRS-80s (among many other machines). I smashed up Ahl’s listings with Joshua Bell’s Applesoft BASIC emulator to make it easy for you to select any of these programs and run them. (When I reached out to Ahl for permission, he let me know that he had placed all of these in the public domain after selling Creative Computing, and Joshua Bell’s emulator is available under an open-source license.)

While Bell was looking for fidelity to the Apple II, I was looking for fidelity to Microsoft 8K BASIC (the back cover proclaims, “All programs run on Microsoft 8K Basic, Rev. 4.0. Basic conversion table included”). I made a few minor edits to the emulator to turn it into what I’ll call the Banana Jr. 80:

  1. The system now defaults to hi-res mode (80 lines) rather than 40 lines, as most of the games evolved from timeshared machines accessed by teletype. But click the Show output button to see a printout of a program run.
  2. The pseudorandom number generator now has a random seed; no RANDOMIZE command is necessary.
  3. PRINTing numbers now pads them with a space to either side.
  4. TAB(0) had to be changed to not indent 10 spaces.
  5. INPUT now appends “? ” to the prompt.

I will make other tweaks as I test more of the games. If you notice anything else than seems off, please comment here.