101_BASIC_Computer_Games_Mar75 101 BASIC Computer Games Mar75

101_BASIC_Computer_Games_Mar75 101_BASIC_Computer_Games_Mar75

User Manual: 101_BASIC_Computer_Games_Mar75

Open the PDF directly: View PDF PDF.
Page Count: 252

Download101_BASIC_Computer_Games_Mar75 101 BASIC Computer Games Mar75
Open PDF In BrowserView PDF
101 BASIC Computer Games

Digital Equipment Corporation
Maynard, .Massachusetts

Additional copies of 101 BASIC Computer Games
are available for $7.50 plus 50 cents postage
and handling from:
Software Distribution Center
Digital Equipment Corporation
Maynard, Massachusetts 01754
write for discount schedule on quantities over 30.
Two supplemental guides are available for use
with this book. They are:
understanding Mathematics and Logic Using
BASIC Computer Games, $4.50. Grades 7-12.
Getting Started in Classroom Computing,
$3.00. Grades 2-7.

1st Printing
2nd Printing
3rd printing

July 1973
April 1974
March 1975

Copyright © 1975 by:
Digital Equipment Corporation
Maynard, Massachusetts 01754

2

Contents
Brief Description
ACEYDU
AMAZIN
ANIMAL
AWARI
BAGLES
BANNER
BASBAL
BASKET
BATNUM
BATTLE
BINGO
BLKJAC
BLKJAK
BOAT
BOMBER
BOUNCE
BOWL
BOXING
BUG
BULCOW
BULEYE
BULL
BUNNY
BUZZWD
CALNDR
CAN-AM
CHANGE
CHECKR
CHEMST
CHIEF
CHOMP
CIVILW
CRAPS
CUBE
DIAMND
DICE
DIGITS
DOGS
EVEN
EVEN 1
FIPFOP

Play acey-ducey with the computer
Computer constructs 'a maze
Computer guesses animals and learns new ones from you
Ancient game of rotating beans in pits
Guess a mystery 3-digit number by logic
Prints any message on a large banner
Baseball game
Basketball game
Match wits in a battle of numbers vs. the computer
Decode a matrix to locate enemy battleship
Computer prints your card and calls the numbers
Blackjack (very comprehensive), Las Vegas rules
Blackjack (standard game)
Destroy a gunboat from your submarine
Fly World War II bombing missions
Plot a bouncing ball
Bowling at the neighborhood lanes
3-round Olympic boxing match
Roll dice vs. the computer to draw a bug
Guess a mystery 5-digit number vs. the computer
Throw darts
You're the matador in a championship bullfight
Computer drawing of the Playboy bunny
Compose your speeches with the latest buzzwords
Calendar for any year
Drive a Group 7 car in a Can-Am road race
Computer imitates a cashier
Game of checkers
Dilute kryptocyanic acid to make it harmless
Silly arithmetic drill
Eat a cookie avoiding the poison piece
(2 or more players)
Fight the Civil War
Play craps (dice), Las Vegas style
Negotiate a 3-D cube avoiding hidden landmines
Prints I-page diamond patterns
Summarizes dice rolls
Computer tries to guess digits you select at random
Penny arcade dog race
Take objects from a pile--try to end with an even
number
Same as EVEN--computer improves its play
Solitaire logic game--change a row of XS to Os

3

Page
13
15
17
19
22
24
26
29
32
34
36
39
42
43
45
47
48
50
52
55
57
59
62
63
65
67
72
73
76
77
78
80
83
85
87
89
91
93
96
98
99

FOOTBL
FOTBAL
FURS
GOLF
GOMOKO
GUESS
GUNNER
GUNERl
HANG

HELLO
HEX
HI-LO
HI-Q
HMRABI

HOCKEY
HORSES
HURKLE
KINEMA
KING
LETTER
LIFE
LIFE-2
LITQZ
MATHDl
MNOPLY
MUGWMP
NICOMA
NIM
NUMBER
lCHECK
ORBIT
PIZZA
POETRY
POET
POKER
QUBIC
QUEEN
REVRSE
ROCKET
ROCKTl
ROCKT2
ROCKSP
ROULET
RUSROU
SALVO
SALVO 1
SLOTS
SNOOPY
SPACWR

Professional football (very comprehensive)
High School football
Trade furs with the white man
Golf game--choose your clubs and swing
Ancient board game of logic and strategy
Guess a mystery number--computer gives you clues
Fire a cannon at a stationary target
Fire a cannon at a moving target
Hangman word guessing game
Computer becomes your friendly psychiatrist
Hexapawn game
Try to hit the mystery jackpot
Try to remove all the pegs from a board
Govern the ancient city-state of Sumeria
Ice hockey vs. Cornell
Off-track betting on a horse race
Find the Hurkle hiding on a 10xlO grid
Drill in simple kinematics
Govern a ·modern island kingdom wisely
Guess a mystery letter--computer gives you clues
John Conway's Game of Life
Competitive game of life (2 or more players)
Children's literature quiz
Children's arithmetic drill using pictures of dice
Monopoly for 2 players
Locate 4 Mugwumps hiding on a 10xlO grid
Computer guesses number you think of
Chinese game of Nim
Silly number matching game
Challenging game to remove checkers from a board
Destroy an orbiting germ-laiden enemy spaceship
Deliver pizzas successfully
Computer composes poetry in 4-part harmony
Computer composes random poetry
Poker game
3-dimensional tic-tac-toe
Move a single chess qUeen vs. the computer
Order a series of numbers by reversing
Land an Apollo capsule on the moon
Lunar landing from 500 feet (with plot)
Very comprehensive lunar landing
Game of rock, scissors, paper
European roulette table
Russian roulette
Destroy an enemy fleet of ships
Destroy 4 enemy outposts
Slot machine (one-arm bandit)
Pictures of Snoopy
Comprehensive game of spacewar

4

101
104
106
109
111
113
115
117
118
120
122
124
126
128
130
133
135
137
138
141
143
146
150
151
153
156
158
160
162
163
165
167
169
171
172
175
178
180
182
185
_ 186
188
189
192
193
196
198
200
201

SPLAT
STARS
STOCK
SYNONM
TARGET
3D PLOT
TICTAC
TOWER
TRAIN
TRAP
23MTCH
UGLY
WAR
WAR-2
WEKDAY
WORD
YAHTZE
ZOOP

Open a parachute at the last possible moment
Guess a mystery nuffiber--stars give you clues
Stock market simulation
Word synonym drill
Destroy a target in 3-D space--very tricky
Plots families of curves--looks 3-dimensional
Tic-tac-toe
Towers of Hanoi puzzle
Time-speed-distance quiz
Trap a mystery nuffiber--computer gives you clues
Game of 23 matches--try not to take the last one
Silly profile plot of an ugly woman
Card game of war
Troop tactics in war
Facts about your birthday
Word guessing game
Dice game of Yahtzee
BASIC programmer's nightmare

205
207
209
212
214
216
218
221
223
224
226
228
230
232
234
236
238
243

Appendices
A
B

C

Families of Games
Game Diagrams
Instructions to Game Authors

5

247
248
249

Preface
This is not the first collection of computer games and simulations nor will it by any means be the last. However, in many
ways it is unique. It is the first collection of games all
in BASIC, It is also the only collection that contains both
a complete listing and a sample run of each game along with a
descriptive write-up.
Educational Value of Games
Educators have widely different opinions as to the educational
value of games. There tends to be agreement that games are
highly motivational and frequently very addictive. Most
educators agree that games generally foster learning by discovery--i.e., the player .doesn't sit down at the terminal with
the purpose of learning a principle of logic but after playing
BAGLES three or four times he most assuredly has learned something about logic. Newton's second law is probably the furthest
thing from the mind of a person sitting down to Play ROCKET.
However, when the player finally lands his LEM successfully on
the moon, the chances are very good that he has discovered
something about gravity varying inversely with the mass of the
LEM and the distance from the moon.
The main objection to games as a learning tool seems to be the
fact that it's largely unguided learning and potentially wasteful of computer time. Art Leuhrmann of Dartmouth joked that
some computer center directors might be willing to pay to not
have the book sold on campus because of the computer time that
would be burned up by playing the games; however, the educational
value of games can be enormous - not only in their playing but
in their creation.
The majority of games submitted tend to simulate a sport, card
or board game, a game of chance or something which already exists.
only a few games begin to use the logical and computational
capabilities of the computer to come up with something new and
truly un ique •
Some tha t do are STARES, BULCOW,. ROCKET ,and
LIFE-2.
Certain games are, of. course, more popular with game authors .that
There were no less than ten versions of NIM submitted,
nine versions each of HORSES (HorSe Race) and TICTAC (Tic-Tac-Toe),
and eight versions of CRAPS. Other popular ones were simulations
of baseball, basketball, football, blackjack, and hangman.
others~

7

Families of Games
A word about the title of the book. The astute, quantitativelyoriented reader might notice that there seem to be mor~ than
101 games in the book. In fact, there are 108 individual games;
7 are different versions of another game.
There are 101 separate
write-ups; thus, the title of the book.
Perhaps it is a disease of using the computer or perhaps it is
just a compulsion of man that he must categorize things. The
games in this book could be categorized by level of difficulty
as is often the case in collections of puzzles. They could
also be categorized in an educational sense, for example, those
that could be used to teach logic principles, those that foster
learing by discovery, those that require the user to solve an
algebra problem, etcc
In the first two groups, Number or Letter Guessing and Piles of
Objects, you will probably get more enjoyment if you play the
games in the numbered order as there is a definite sequential
nature to their difficulty. In the other fourteen categories,
the games may be played in any order; one does not generally
build upon another except in a few cases. In particular, you
should play~
BAGLES before BULCOW
before lCHECK
HI-Q
BATTLE before SALVO
GUNNER before SUNERI
ROCKET before ROCKT2
HMRABI before KING

Equipment to Play, computer and Otherwise
Most of the games in this book require no special knowledge, tools
or equipment to play, except, of course, a BASIC-speaking computer.
Four of the matrix games will probably be more enjoyable if you
use a grid or quadrille paper to play. Unless you have a photographic memory, QUBIC almost certainly requires a diagram. There
is a page included as Appendix B which contains some supplemental
diagrams; you may wish to reproduce it if you become addicted to
the games on it.
with few exceptions, the games all run in "standard" BASIC. Any
exceptions are noted in the write-ups under the heading, "computer
Limitations." The major difference between various computer systems
appears to be in the handling of alphabetic strings. On Digital
systems a subscripted string variable. for example, A$(8) or Cl$(15),
refers to a variable in an array or matrix. Other BASIC compilers
may not have string arrays.
8

On some systems, in particular, Digital's Edusystems 20, 25, and 50,
strings are limited to 6 characters. Several strings may, or course,
be combined in an array to permit longer than 6-letter words to be
used.
Many programs use the RANDOMIZE command to start the random number
generator at a random point. Some BASIC compilers do not recognize
RANDOMIZE and it must be removed in order for the program to run.
Digital BASIC permits more than one statement on each program line.
Statement separators on the line may be one of three characters -/ or : o r O •
Digital Equipment Corporation
Maynard, Massachusetts
July 1973

9

ACKNOWLEDGEMENTS
Rusty Whitney
Oregon Museum of Science and Industry
Portland, Oregon
Bob Albrecht
People's Computer Company
Menlo Park, California
Walt Koetke
Lexington High School
Lexington, Massachusetts
Charles Lund
The American School of the International Schools
The Hague, Netherlands
Mary C. Jones
Southwest High School
Fort Worth, Texas
Victor Nahigian (student)
Weston High School
Weston, Massachusetts
Keiwit Computation Center
Dartmouth College
Hanover, New Hampshire
Education and DECsystem-lO Groups
Digital Equipment Corporation
Maynard, Massachusetts
Illustrations courtesy of:
MAD Magazine
Scot~Foresman & Co.
Bob Barner
Creative Publications
Peoples Press
and several other sources.

10

~ The Games ....

11

ACEYDU

ACEY DUCEY CARD GAME

Description
This is a simulation of the Acey Ducey card game.
In the
game, the dealer (the computer) deals two cards face up.
You have an option to bet or not to bet depending on whether
or not you feel the next card dealt will have a value between
the first two.
Your initial money (Q) is set to $100; you may alter Statement
170 if you want to start with more or less than $100. The
game keeps going on until you lose all your money or interrupt
the program.
Program Author
Bill Palmby
Adlai E. Stevenson High School
Prairie View, Illinois
60069

13

"s~1!: ~~~k"

PROGRAM LISTING
LISTNH
10 REM
GAME OF ACEY-DUCEY WRITTEN BY BILL PALMBY
20 REM
ADLAI STEYENSON.HIGH SCHOOL, PRAIRE YIEW, ILL
30 REM ••• TRANSLATED TO RSTS/E BY DAVE A'HL, DIG !TAL
100 RANDOMIZE
101 PRINT "ACEY-DUCEY IS PLAYED IN THE FOLLOWING MANNER:'
102 PRINT "THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP. "
103 PRINT "YOU HAVE THE OPTION TO BET OR NOT TO BET DEPENDING"
;.04 PRINT "ON WHETHER OR NOT YOU FEEL THE NEXT CARD WILL HAVE'
105 PRINT "A VALUE BETWEEN THE FIRST TW~ ,
106 PRINT" IF YOU Dt} ·NOT WANT TO BET, INPUT A 0. '
He PRINT
160 N=100:Q=100
190 PRINT "YOU NOW HAVE'Q'DOLLARS. '
195 PRINT
200 GOTO 260
210 Q=Q+M
220 GOTO 190
240 Q=Q-M
250 GOTO 190
260 PRINT "HERE ARE YOUR NEXT TWO CARDS.
270 A=INT(14*RND)+2
290 IF A{2 lHEN 270
290 . IF 1'1:>14 THEN 270
300 B=INT(14~RND)+2
310 IF B<2 THEN 300
320 IF B)14 THEN 300
330 IF A)=B THEN 270
350 IF 1'1<11 THEN 400
360 IF 1'1=11 THEN 420
370 IF 1'1=12 THEN 440
380 IF 1'1=13 THEN 460
390 IF 1'1=14 THEN 480
400 PRINT A
410 GOTO 500

*.*
*••

.·,;.~:eINN~">: ~ .

"~' '

. ','

YOU NOW HAVE 100 DOLLARS.
HERE ARE YOUR NEXT TWO CARDS.
6.
1e,
WH.A; IS, YOUR BET? 10
6
SORRY, YOU LOSE.
YOU NOW HAVE 90 DOLLARS.
.
'HERE
YOUR NEXr' TWO CARDS.
6
QUEEN

ARE

WHAT IS YOUR BET? 20
JACK

YOU WIN!!!
YOU NOW HAVE 110 DOLLARS,
HERE ARE YOUR NEXT TWO CARDS.

le

'KING
WHAT IS YOUR BET? 0

CHICKEN! !
HERE ARE YOUR NEXT TWO CARDS.
2
9

42e PRINT "JACK"

430
440
450
460
470
480
500
510
520
530
540
550
569
578
5S8
590
690
620
620
630
650
660
670

GOTO 500
PRINT "QUEEN"
GOTO 500
PRINT "KING"
GOTO 500
PRINT "ACE'
IF 8{21 THEN 550
IF B=11 THEN 570
IF B=12 THEN 599
IF 8=13 THEN 610
IF B=14 THEN 630
PRINT 8
GO TO 650
PRINT "JACK'
GOTO 650
PRINT "QUEEN"
GO TO 650
PRINT "KING"
GOTO 650
PRINT "ACE"
PRINT
INPUT "WHAT IS YOUR BET',M
IF M00 THEN 690

675 PRINT

lmAT 15 YOUR BET? 30
10
SORRY, YOU LOSE.
YOU NOW HAVE 80 DOLLAR~
H~RE ARE YOUR, NEXT TWO CARDS.

.8.
WHAT IS YOUR BET? 20
SORRY, YOU LOSE.
YOU NOW HAVE 60 DOLLAR~
HERE ARE YOIJR NEXT TWO CARDS.
9
QUEEN
lmAT IS YOUR BET? 0
"CHICKEN' !
HERE ARE YOUR NEXT TWO CARDS.

:2
4

l~HAT,1 S YOUR

"CHICKEN~!M;PRINT

690 PRINT "SORRY,
~'00 PRINT

a

MY FRIEND,

H~RE: ARH'IbUR

BUT YOU BET TO'O MUCH'

"YOU HAVE ONLyaQ"OCILLARS TO.. BET.

0

,NEXT...

T~b

CARDS.

U

10

GOT
650
.~,
C=INT<14*RND)+2
IF C{2 THEN 730
IF C)14 THEN 730
IF C"ORRY, MY FRiEND, BUT .VOU BET TOO MUCH
VoU HAVE ON~Y 60 DOLLARS TO BET.

a

WHflT IS YOUR BET? 60 .

5'
"fOU'WIN!! !
YOU NOW HAYE 120 DOLLARS.
HERE ARE YO~R NEXT TWO CARDS.
5

9
. WlHAi LS YOUR BET?' 20
.", .. " , "'p.

SO~R"', YOU LOSE.

. YOu' HO.lI #~"E411.e· DOLLARS.
. ,,{ERE fiRE 'YOUR NEXT TWO CARDS.

3

'"

....

,

'·'8 .
l~HAT IS "QUR BET? 90
10
SORRY, YOU LOSE.
YOU NOW HAVE 10 DOLLARS.
HERE ARE YOUR NEXT TWO CARDS.

READY

2
JACK
I~HAT IS YOUR 9ET? 10
QUEEN
S'ORRY, YOU LOSE.

SORRY, FRIEND, BUT YOU BLEW YOUR WAD.
TRY AGAIN (YES OR NO)? NO
O. K.

14

! .

,. ,0,"

,:.. $CEY~P1!CEY IS p'i.fiYED I,N THE.,lCij..LoWING 'i'I1!NNER:':"
'JHE DEilL.ER (COA(>u1ER) 'QEALS.'·TWO C~RD.·I'ACE Lif···'
....6U· HAVE" THE OP't'H'N TO' BET 'oin'WT TOElET DEPE~DING
ON WHETHER OR NOT YOU FEEL THE NEXT CARD WILL HAYE
A VALUE BETWEEN THE FIRST TW~
JF YOU DO NOT WANT TO BET, INPUT
0.

HOPE YOU HAD FUN!!

AMAZIN

DRAW A MAZE

Description
This program will print out a different maze every time it
is run and guarantees only one path through. You can choose
the dimensions of the maze--i.e. the number of squares wide
and Iong-.
computer Limitations
The amount of memory available will determine the maximum
size maze that may be constructed. An 8K EduSystem 20
initialized for one user can draw a l3x13 maze. RSTS/E
can draw a 23 (width of paper limit) x 50 maze, even larger
using virtual memory.
Experiment on your system with the maze dimensions in
Statement 110.
Program Author
Jack Hauber
Loomis School
Windsor, CT 06095

15

PROGRAM LISTING
AMAZIN
190
119
129
121
122
130
131
1]2
140
141
159
151
160
161
162
163
170
171
172

H3
180
190
191

192

1n
200
201
202
219
211

220
221
222
230
231
232
240
250
260
261
210
280
290
]00
310
320
321
323
330
331
332
333
340
350
360
361
362
370
]~9

381
390
490
401
410
411
412
420
430
440
441
442
450
460
461
4;'0
480
481
482
490
500
510
511
520
530
540
541
542

5s0
551
552
55]
560
570
580
581
582
590
600
691
610
620
621
622
630
640
650
651
669
670
6ee
681
699

EDUSY5TEM 30

691
692
700
710
728
721
730
740
750
751
752
760
770
780
790
800
801
802
810

LET G=l
GO TO 830
,
IF WCR.5+1)C)0 THEN 730
LET X=INTCRNDI0.)*2+1)
IF X=l THEN 860
IF X-2 THEN 910
GO TO 860
IF 50Y THEN 760
IF 2=1 THEN 780
LET G=l
GO TO 770
IF W(R.5+11(>0 THEN 780
GO TO 910
GO TO 1000
LET WCR-l. SI=C
LET C=CH
LET VCR-l.SI=2
LET R=R-l
IF C=H*Y+l THEN 1010
au LET Q=0
812 GO TO 260
820 LET NCR.S-l)=C
830 LET C=C+1
840 LET Y(R.5-1)=1
841 LET 5="5-1
842 IF C=H*V+l THEN 1010
859 LET a-B
851 GO TO 260
869 LET ·WCRH. s)=e
870 LET C=C+1
871 IF VIR.51=0 THEN 880
S72 LET V(R.SI=3
873 GO TO 890
S8e LET V(R.5)=2
890 LET R=R+l
99B IF C=H*V+l THEN 1010
992 GO TO 530
910 IF Q=l THEN 960
920 LET W(R.S+l)~C
921 LET C-C+1
922 IF VCR.51=0 THEN 940
939 LET VCR.51=3
931 GO TO 950
940 LET VCR.S)=l
959 LET 5=5+1
951 IF C-H*Y+l THEN 1010
952 GO TO 260
969 LET Z=l
97e IF V(R.51=0 THEN 980
971 LET V(R.S)=3
972 LET G=0
973 GO TO 1000
980 LEl v(R.SI=l
981 LET G=0
982 LET R=l
990 LET 5=1
991 GO TO 250
1009 GO TO 210
1910 FOR J=l TO
1011 PRINT"I";
1012 FOR 1=1 TO H
1013 IF VCI.J)(2 THEN 1030
1020 PR·I NT"
";
1921 GO TO .1040
1030 PRINT"
I";
1040 NEXT I
1041 PRINT
1943 FOR 1=1 TO H
1045 IF VCI.J)=0 THEN 1060
1059 IF Yel.J)=2 THEN 1060
1951 PRINT":
"J
1952 GO TO 1079
1060 PRINT" "--"J
1079 NEXT I
1071 PRINT":
1072 NEXT J
1073 END

RANDOMIZE
DfM We2$.1031.ye25.1031
PRINT "WHAT ARE YOUR WIDTH AND LENGTH?'
INPUT H.Y
PRINT
IF H()l THEN 150
IF Y()l THEN 150
PRINT "MEANINGLESS DIMENSIONS. TRY AGAIN"
PRINT
GO TO 120
PRINT
PRINT
LET Q=0
LET 2=0
LET X=INTCRNDI91*H+1)
FOR 1-1 TO H
IF I=X THEN 17]
PRINT ": --"J
GO TO 180
PRINT
"J
NEXT I
PRINT":"
LET C=l
LET WeX.1I=C
LET C=C+l
LET R=X
LET 5=1
GO TO 260
IF R()H THEN 240
IF S()V THEN 230
LET R=l
LET 5=1
GO TO 250
LET R=l
LET 5=5+1
GO TO 250
LET R=R+l
IF weR.51=0 THEN 210
IF R-l=0 THEN 538
IF weR-l.51()0 THEN 5]0
IF 5-1=0 THEN 390
IF weR.5-1)<>0 THEN 390
IF R=H THEN 330
IF WCR+l.S)()0 THEN ]]0
LET X-INTCRNDe01*3+1)
IF X=l THEN 790
I F x-a THEN 820
IF X=3 THEN 860
I F SOY THEN 340
IF 2=1 THEN 370
LET Q=l
GO TO 350
IF WCR.5+1)()0 THEN ]70
LET X=INTCRNDe01*3+1)
IF X=l THEN 790
IF X=2 THEN 820
·IF X=3 THEN 910
LET X=INTIRNO(0)*2+1)
IF X=l THEN 790
IF X=2 THEN 820
IF R=H THEN 470
IF WCR+l.5)()0 THEN 479
I F SOY THEN 420
IF 2"1 T~EN 450
LET Q=1
GO TO 430
IF WCR.5+1)<>0 THEN 450
LET X=INTCRNoe01*3+1)
IF X-l THEN 790
IF X-2 THEN 860
IF X=3 THEN 910
LET X=INT.(RNPC01*2+11
IF Xc l tHEN 790
IF X=2 THEN 860
I~ S¢)Y THEN 490
IF 2=1 THEN 520
LET Q=1
.
GO TO 500
IF W(R.S+l){)0 THEN 520
LET X=INTCRNO(0)*2+1)
IF X=l THEN 790
IF X=2 THEN 910
GO TO 790
IF 5-1-9 THEN 670
IF NCR.S-1)()0 THEN 670
IF R=H THEN 610
IF WCR+l.SI<)0 THEN 610
IF SOY THEN 560
IF Z=1 THEN 590
LE.T Q=l
GO TO 570
IF WCR.S+1)()0 THEN 590
LET X=INT(RNPC0)*l+1)
IF Xcl THEN 820
IF X=2 THEN 860
IF X=3 THEN 9i0
LET X=INHRNO(0)*2+1)
IF X=l THEN 820
IF X=2 THEN 860
IF S()V THEN 630
IF 2'1 THEN 660
LET Q=l
GO TO 640
IF WC~S+1)C)0 THEN 660
LET X=IHTCRND(01*2+1)
IF X=l THEN 820
IF X=2 THEN 910
GO TO 820
IF R=M THEN 740
IF W(R+1,5)<>0 THEN 748
IF SOYTHEH 700
IF 2=1 THEN 730

SAMPLE RUN
AMAZIN

EDU5YSTEM 30

WHAT ARE YOUR
79.7

Wl~TH

AND LENGTH?

'-- '-- '-- '--' --' --'
I

:-- :--: --:

'-- :-- :-- :-- :--: --.
READY

16

.

ANIMAL

COMPUTER GUESSES YOUR ANIMAL

Description
. Unlike other computer games in which the computer picks a
number or letter and you must guess what it is, in this
game you think of an animal and the computer asks you
questions and tries to guess the name of your animal. If
the computer, guesses incorrectly, it will ask you for a
question that differentiates the animal it guessed from the
one you were thinking of. In this way the computer IIlearnsll
new animals. Questions to differentiate new animals should
be input without a question mark.
IMPORTANT: At the end of a playing session, to the question,
IIARE YOU THINKING OF AN ANIMAL, II you must respond IISAVE II
in order that the computer save all the new animals you have
introduced. To that same question, at any point in the game,
if you respond IILIST,II the computer will tell you all the
animals it knows so far.
The program starts originally by knowing only "FISH II and
IIBIRD.II Additional animals are stored in the file IIANIMAL.GME. II
Computer Limitations
This program was written for a DIGITAL RSTS-ll and uses several
unique features, in particular, multiple user access to a
common data file and several advanced string handling functions.
It has been converted with some minor changes to OS/8 BASIC
and could be adapted to other systems as well.
Program Author
Nathan Teichholtz
Digital Equipment Corporation
Maynard, MA 01754

17

<..

PROGRAM LISTING

SllMPLE RUN
PLiw 'dUESS THE ANIMAL' WITH RSTS
THINK OF AN ANIMAL AND THE COMPUTER WILL. TRY TO GUESS IT".

04144 PM

IU
150
590
525

"PLAY 'GUESS THE ANIMAL' WITH RSTS
"THINK Of AN ANI~AL AND THE COMPUTER WILL TRY TO GUESS IT ...
DIM Al12eB'
FS"ANIMAL.GME'
,ON ERROR GOTO 700
550 OPEN FS FOR INPUT AS FILE IX
,INPUT ~u'Nf
,INPUT .1,ASlh) FOR h'IUO NX'

·,&

II
'U (0X hNUMS I NX)
,ON ERROR GOTO 0
.GOTO 1300
700 ON ERROR GOTO 1050
IFS·"S".FS
'RESUME 550
1050 READ ASIIX) FOR Ix.0X TO 3X
1100 DATA "4","\GDOES IT SWI~\Y2\N3\',"\AFISH""\ABIRD"
1300 INPUT "ARE YOU THINKING OF AN ANIMAL",Z9S
,GOTO 1350 IF LEFTlZ9S,lX)"Y'
,GOTO 1300 ,IF. LEfTIZ9S,lI) .. N.
1310 IF Z9$"SAYE' TH~N
OPEN 'ANIMA'L,G"E" FOR OUTPUT AS FILE IX
,PRINT #U,ASIU) FOR IX-a. TO YAL(AS(0Xl)
,PR INT*!, CHRS (2el)
'CLOSE IX
'GOTO 1300
1320 IF ZpSo"LIST" THEN
,CLOSE

~m~r"~~!~~~~! lI~~~i:~; ~~O~N~m ;., AS(!Xl, "w,
,PRINT

FOR

U' U

TO

200X

,GOTO !J00

1350 KX.!X
14B0 KX.FNAXIA$(KXll
,GOTO 30m0 IF LEN(AS(KX.)l'0X
,GOTO 1400 IF L~FTCA$IKX),2X""\Q"
,PRINT "IS IT A 'RIGHT!ASIKX,,3111
,INPUT Z7S
,Z7 S'LEFT (Z7S, IX)
1450 IF Z7s."V" THEN
PRINT "WHY NOT TOY ANOTHER ANI~AL"
,GOTO 1300
'
2000 INPUT "THE ANIMAL YOU WERE THINKING OF WAS A "1Z9S
2050 PRINT 'PL·EASE TYPE :'IN' A QUESTION THAT WOULD DISTINGUISH A "
ZpS • FRO~ A 'RIGHTCASCKI),3%l
,INPUT lSS
2100 PRINT "FOR. 'ZU" THE ANSWER WOULD BE"'
,INPUT Z75
,Z7S'LEFTCZ75, U)
'IF Z7S. II V" TIotEN Z6S."NELSE IF Z7S.IINII TMI!N Z15S.IIV11
ELSE PRINr 'PLEASE ANSWER 'Y~S' 00 INO'"
IGOTO 2100
2200 ZlhYALCA$(0Ill
'AS (0X)'NUMSIZI %+2X'
,ASIZIX)·AsCKXl
,A$(ZIX+lx)·'\A!+Z9S
.
,AS (Kll. "\Q ·.Z85+" \ '+Z7S-NU~S IZ I h I X)-"\ "-ZS'.NUMS I Z I %, -"\'
2300 GOTO 1300
3000 OEF ~NAX(Q$l
,PR I NT HID CQS. 3%, INSTR (JX, QS, '\" )-3%"
IlNPUT Z95
'Z9S'LEFTI Z95, U'

ARE YOU THINKING OF AN ANIMAL? YES
DOES IT SWIM? YES
IS IT A FISH? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? SEAL
PLEASE T~PE IN A QUESTION THAT WOULD DISTINGUISH A SEAL FROM A FISH
? DOES IT HAVE FLIPPERS
FOR A SEAL THE ANSWER WOULD BE? VES
ARE VOU THINKING OF AN ANIMAL? YES'
DOES IT .SW I M? NO
IS 'IT A BIRD? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? ELEPHANT
PLEASE TYPE IN A QUESTION THAT WOULD DISTINGUISH A ELEPHANT FROM A BIRD
? DOES IT HAVE A TRUNK
FOR A' ELEPHANT THE ANSWER WOULD BE? YES
ARE YOU THINKING OF AN ANIMAL? YES
DOES IT SWIM? NO
DOES IT HAVE. A TRUNK? NO
IS IT A BIRD? NO
'
THE ANIMAL. YOU WERE THINKING ,OF WAS A ? DOG
PLEASE TYPE IN A QUESTION THAT WOULD DISTINGUISH A I>OG FROM A BIRD
? DOES IT GO 'ARF, ARF'
FOR A DOG THE ANSWER WOULD BE? YES
ARE YOU THINKING OF AN ANIMAL? YES
DOES IT SWIM? NO
DOE5 I T HAVE A TRUNK? NO
DOES IT GO 'ARF? NO
IS IT A BIRD? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? CIIT
PLEASE TYPE IN A QUESTION THAT WOULD DISTINGUISH A CAT FROM A BIRD
? DOES IT HAYE RETRACT! BLE' CLAWS
FOR A CAT THE ANSWER WOULD BE? 'IES
ARE YOU THINKING OF AN' ANIMAL? YES
DOES IT SWIM? NO
DOES IT HAVE A TRUNK? NO
DOES IT GO 'ARF? NO
DOES IT HAVE RETRACTIBLE CLAWS? YES

IS IT A CAT? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? TIGER
PLEASE TYPE IN A QUESTION THAT WOULD DISTINGUISH A TIGER 'FROM A CAT
? DOES IT LIVE I N THE JUNGLE
FOR A T!GER THE ANSWER WOULD BE? YES
ARE YOU THINKING OF AN ANIMAL? YES
DOES IT SWIM? NO
DOES IT HAVE A TRUNK? NO
DOES IT GO 'ARF? NO
DOES IT HAVE RETRACTIBLE CLAWS? NO
IS IT A BIRD? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? cow
PLEASE TYPE IN A QUESTION THAT. WOULD I>ISTiNGlJISH A COW FROM A BIRD
? DOES IT GIVE MILK AND GO 'MOO'
",OR A COW THE ANSWER WOULD BE.7. YES
ARE YOU THINKING OF AN ANIMAL? YES
DOES IT SW I M? NO
DOES IT HAVE A TRUNK? NO
DOES IT ·GO 'ARF? NO
DOES IT, HAVE RETRACTIBLE CLAWS? NO
DOES IT GIVE MILK AND GO"MOO"? NO
IS IT A BIRD? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? GOAT
PLEASE TYPE IN A QUESTION THAT WOULD DISTHIGUISH A GOAT FROM A BIRD
? DOES IT GIVE MILK AND EAT TIN CANS AND ALMOST ANYTHING ELSE
FOR A GOAT THE ANSWER WOULD BE? YES
ARE YOU THINKING OF AN ANIMAL? YES
DOES IT SWIM? YES
DOES IT HAVE FLJ PPERS? NO
IS IT A FISH? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? WHALE
PLEASE TVPE IN A QUESTION THAT WOUL!> DISTINGUISH A WHALE FROM A FISH
? IS IT THE LARGEST KNOWN MAMMAL.
FOR A WHALE THE ANSWER WOULD BE? YES
ARE 1'01:1 THINKING OF AN ANIMAL? LIST
ANIMALS I ALREADY KNOW ARE;
SEAL
ELEPHANT
DOG
CAT
TI GER~
COW
BIRD
GOAT
FISH
WHALE

IZ9s- fl N" IF Z9sc> Jt V"

,ZI hIN8TO(3%, Gi, 'V-Z9S) .2X
,Z2X'INSTR IZI X. QS, "\"l
,FNAX.YAL I MID (QS. Z 1 X, Z2X.Z I X) l
,F NENO
9999 END

ARE YOU
. DOES H
DOES IT
DOES IT
DOES IT
DOES IT
.DOES IT

'THINKING 'OF AN ANIMAL? YES
SWH'!? NO
HAVE A TRUNK?· NO
do >ARf? .:/jo
,
HAVE RETRACTIBLE CLAWS? NO
GIYE'.NILKAND GO 'MOO'? NO
GIVE MILK AND ERT .TIN CANS AND ALMOST ANYTHING ELSE?NO
IT A BIM? NO
THE -ANIMAL ,YOU' WERE THINKI.Nll OF WAS A .? SHEEP
PLEASE TYPE IN.' A QUESTION~THAT .WOULD DISTINGUISH A SHEEP FROM A BIRI>
? .DOES IT HAVE A WOOLY COAT AND SAY 'BAA, BAA'
FOR A SHEEP THE ANSWER WOULD BE? YES
ARE· YOU THINKING ..
,AN ANIMA!.? YES
'DOES" IT SWIM? NO
.'
DOES I T HAVE A TRU'NK? NO
DOES IT GO 'ARF? NO
DOES IT HAVE RETRACTlBLE CLAWS? YES
DOES,IT LIVE IN THE JUNGLE? YES
IS IT A TIGER? NO
THE ANIMAL YOU WERE THINKING OF WAS A ? LION
PLEASE T'>'PE IN A QUEStION THAT WOULD DISTINGUISH A LION FROM A TIGER
? IS It THE KING OF THE JI,JNGLE
. FOR .ILL ION THE ANSWER WOULD BE? YES

", :is

0"

'::: ~g~. ;~:~~~;g g~ ~~ :~i~=t ~ ~~VE
ARE .VOU T.H.INKING OF AN ANIHAL? -C

.READY

18

AWARI

REMOVE BEANS FROM THE PITS

Description
My SIDE
6

5

4

3

2

1

000

000

000

000

000

000

My
HOME

Your
HOME
000

000

000

000

000

000

1

2

3

4

5

6

Your SIDE
AWARI game is played with seven sticks and thirty-six stones
(beans) laid out as shown above. The board is divided into six
compartments (PITS) on 'my SIDE' and six on 'your SIDE'. In
addition, there are two special PITS at the ends: 'my HOME'
and 'your HOME' •
A MOVE is made by taking all of the beans from any (non-empty)
PIT on your own SIDE. Starting from the PIT to the right of
this one, these beans are 'SOWN' one in each PIT working around
the board anticlockwise.
A TURN consists of one or two MOVEs.
If the last bean of your
MOVE is SOWN in your own HOME you may take a second MOVE.
If the last bean SOWN in a MOVE lands in an empty PIT, provided
that the opposite PIT is not empty, all the beans in the opposite
PIT, together with the last bean SOWN are 'captured' and moved
to the player's HOME.
When either side is empty, the game is finished.
with most beans in his HOME has won.

19

The player

In the computer version, the board is printed as 14 numbers
representing the 14 PITS.
3

3

3

3

3

3

3

3

3

3

3

3

0

0

The PITS on your (lower) SIDE are numbered 1-6 from left to
right. The PITS on my (the computer's) SIDE are numbered from
my left (your right).
To make a MOVE you type in the number of a PIT.
If the last bean
lands in your HOME, the computer types 'AGAIN?' and you then type
in your second move.
The computer's MOVE is typed, followed by a diagram of the board
in its new state. The computer always offers you the first move.
This is considered to be a slight advantage.
There is a learning mechanism in the program that causes the
play of the computer to improve as it plays more games.
computer Limitations
This program is written in DIGITAL PDP-II BASIC. The only
unusual feature is that an IF statement may have the form:
IF (CONDITION) THEN (STATEMENT)
Whenever the IF condition fails, the program branches to the
next line.
Program Author
A version of AWARI, called KALAH, was submitted by Christopher
Stolz of Lexington High School. The version published (also
known as BEANS) along with the description above was written by:
Geoff Wyvill
Bradford University
Bradford, Yorkshire, England

20

SAMPLE RUN

PROGRAM LISTING

RUN

5 DATA0
10 DIMB(13"G(13',f(50"Rf::ADN
lb FORI'~TO'"_I:READF(j)INtXlI
2i:1 PHINT-\PRINT "GA.ME OF ••• AWAHI ••• "\E.0
25 FDRI'0TOI21L.ETB(l"3I N EX11
30 L.t TC'0: LETH")'0 :LETB (13) '01 LEH (6)'0

35

AlmRI

01:23 PM

GAME OF

16-t'lFf)'-7J

AWARI

3

3

GOSU~50"

40 PRINTuYOuR MOVEIIJIGOSUB11f21

45
50

IFt:'0GOTU8~
IFM."'THtt~GCJSLJ!:l-10\A

YOUR t1OVE? 5

55 IFE'.GOT(j80
60 PRINT/lt'1Y MovE IS 1I.IGOSUI:i800

65

IFEc~GOT080

10 IF!-ICHTHfNPRINT",
75 IFf;:>i:GOTQ3!)

80

PRINT:PRI~T"GAM~

II,

3
]:

IGOSUB800

J:

MY MOVE IS 2

OvER"

85 LE.T D::I8(6) .. ~n13'IIF 0<0 THEN PRINT "I WIN BY",-D"POlf..ITS":GOTQ

]:

2~

444

4

90 I..ETN=N+l11f.{).0THENPRI'''1"DR.AWN GAME"tGO'TO 20

95 PRINTuyOU wIN tlyuDuPOINTS"IGOT020
100 PRI~T'tA~A!NIIJ
1113 !I\iPUTM 11 F ,",·<7 T~EN IfM>0 THENlET"'.1-\"ll GOTO 130

\'OUR MOVE? 4

120'PRlf'liTIIILLEGAL MOVE"*GOTOlo(J0
130 lfB(M)'"GOTO!20
14~

LETH.b=GOSU~20a

150 GOTOSV'
LETK :,"1: GOSlI86~J~
21215 LE::Tfilli:0 t IFK>6Tr-lENLETK=I\-7
20~

AGAIN?

2U~ L~TC=C.l: IFC<9THENLf.. TF (IV' -F (N) .0+1<
215 FORl=~T05;IF~(I)<>~TMEN230
22" NEXT I
225 RETURN
23~ F OR lOnG 12: IFB (I) <>OTHENLE Tt =11 RfT URN
235 GaTa 2?0

500 PRINTrPRINT"

MY MOVE

520 PRINT,"
525 FOR I =,H051 GQSU8580
53~ Nt. ~ T I

"1IPRINT~(0)IPRINT"

535

PRINT:P~I~T:RlTURN

51"~

IFii(l) 13 THENLET M.M-14
610 LI::.Tb(M).f3(~1)"'ltNEl(TP
615 JFl:j CM) _11!-lE N IF M<>ti THEN I FM<> 1 J T!-IEN 1 Fa (t 2-M) <>0GOT062ts

4

620 RI:.TI.JPN

7

625 LETa (H) cb (H, +6 (12-M) +1 ,LF. 18 (") -0ILETa (12-M) =0: RETURN
800 LETD"9Y'lETH'13
805 FORI.v.;T013ILEfG(I)=8CI)tNE)(TI
810 FORJ'7TO!2I1FB(J),.THE'885

MY MOVE IS 5

100

4

9

815 LETQc~·:LETI"=JJGOSU8600
820 FDRr."T051IF"(!).~GOTG8'5
YOUR MOVE? 2

825 LtTI.-=ti(1)+I:L!::.TR=0
8~0

IFL>lJT~ENLETL_L·'4'LETR.lIGOT0830

835 I F8 (L) =V>THE~ IFL<>6 T HEN I FL<:> 13THENLE TR -B ( 12-L ) +R
84~ IFR'QT"E-LETQ'R
845 NEXT!

o

10
2

2

8

850 LUQ'dCI3)-6C6)-Q:IFC>8GOT0875

855 LETK'JIIFK>6T"I'.NLET<'K-7
B6Q1 FORI h'TuN .. l tIFF' (N) *0.1(= INl (F C1) 16 ... C7 .. C) .... 1'
870 NEXT!

AGAIN?
THc.NLEn~.Q-2

o
1121

875 FQRl=v.T013:LET8(I)=GCI):NE'iTI

860 JFQ>cQTHENL~TA.JILETD=Q
885 NEXTJ
89t:'! LEH'·.A:PRINTCHR$(42"'1>\)' :GOT020~
901'l FORI:arJ:10N-1IPRINH(I):I\iE)(TJ

MY MOVE IS 6,1
1

999 END

1

10

o

8

YOIJR MOVE?

1.

1
(1

J

AGAIN? 4

12
10

t1Y MOVE IS

10

12

o

10

YOUR 11O'./£?

o

2

11

o

MY MOVE 15 G,4
o 1 0
14

15

2

15

-YOIJR MOVE? 5

14

o

o

o

o

2

GAt1E OVER

YOU WIN BY 1 POINTS

21

o

17

BAGLES

NUMBER LOGIC GAME

Description

The computer picks a 3-digit secret number and you attempt
to guess what it is. You are allowed up to twenty guesses.
No digit is repeated. After each guess the computer will
give you clues about your guess as follows:
PICO
FERMI
BAGLES

One digit is correct, but in the wrong place
One digit is in the correct place
No digit is correct

You will learn to draw inferences from the clues and, with
practice, you'll learn to improve your score. There are
several good strategies for playing BAGLES. After you have
found a good strategy, see if you can improve it. Or try
a different strategy altogether and see if it is any better.
This program was submitted from several sources including
Dartmouth and U.C.-Berkeley. The one published here is
from U.C.
Program Authors
D. Resek, P. Rowe
Lawrence Hall of Science
University of California
Berkeley, CA 94700

22

PROGRAM LISTING
L ISTNH

REM
1(1
i5
20
25
30
40
7/.3

***

SAMPLE RUN
RUNNH
GRt1E OF 8AGlES

SAGLES NUMBER GUESSING GAME

ORIGINAL SOURCE U~~KNOrm BUT SUSPECTED TO BE LmJRENCE HALL
OF SCIENCE, U. C BERKELEY.
NO[)IFIED FOR TH1E5HARE(i-8
B'r' STUDENTS OF L,.EiHNGTON HIGH SCHOOL.. ~lfl mw MO[HFIED FOR
REM "+:** RSTS/E B"r' DAVE AHL OF [) I G r TAL 11/4~j GROUP
DIM Al(6), A(3), Ben
F:At~DOM I ZE: "'=0: T=255
INPUT "GAME OF SAGlES.
I-lOULU YOU LIkE THE PULES (YES OR NO)"; A$

R:Ef1
REM
REM

***

90 IF A$="NO" THEN 150

O. K.

GUESS '"' 1 ?
PICa PICO

II

160 A(I)=INT(i0*RND;'

170 FOR J=l TO I-1
180 IF A(I)=A(J) THEN 160
19~3 NE;:.::T ..1
268 NE::8(J) THEN 410
C=(:+1

410

NE~--{T

300
11121

32121
1]0
34121
35121
360

370
3:80

A

NUMBER IN

MIND. "

O. I<
I HA'IJE A NUt1BER IN MIND
GUESS "* 1 ? 123
PICa PICO
GUESS # :::" ? 4L~
PICO FERtH
GUESS # J ? 2::t.5
PICO
GUESS # 4 ? 43:2

FEP'lI FERe1!
GUESS :It .':5 ? 43:1
',.'OU GOT IT! ,!

PL AY AGA! N ('r'ES OR NO)? '1'E:;
O. fC
HRVE R NUMBER
GUESS # 1 ? :123

GUESS #

? 451

HRGLES

OU£S:; '"'
267
BAGLES
GUESS :It 4
3:39
PICO PICO PICO
GUESS '"' .'5 ? ::393
PIC!) PICO PICO
GUESS # 6" -~. 93·9
Y-OU GOT IT!! I

.J

44121 IF A(3)(>8<1) THEN 460
45~3 C=C+l

46(1 FOR ·J=1 TO 3
4713 IF A (.]){>8(,.1;' THEN 49.0
48.0 0=0+1
49~j NE::8(3) THEN 440
430 (:=C+1

620 GOTO

:123:

GUESS # _2 ? 412
PICO PICO
GUESS # J ? 215
PICO PICO FERtH
GUESS "* 4 ? 251
'·IOU GOT IT '!!

PLA';' AGAIN (',.'ES Of': NO)? 'T'ES
HAVE

220 FOR 1=1 TO 20
23:0 PRINT "GUESS #"L
2.'5~3

J HRVE R WJMBEFi: J N t1 I ND

I

210 PRINT PRINT
24~3

('T'ES OR NO)? '1'E5

I At1 THINKING OF A THREE-DIGIT NUt1BER
TR'1' TO GUESS
t1Y NUt'lBER RND I L~ I Ll G I '.,.'E ,",'OU CLUES AS F'OLLOL~5:
PIca
- ONE [:tIGIT CO~:f':ECT BUT IN THE L~f;.'ONG POSITION
FERMI
- ONE DIGIT COFi:RECT ANG'. IN THE f.i:IGHT POSITION
SAGlES - NO DIG 1 TS (:ORf;.:ECT

100 PRINT:prHNT "I AM THINkINCi OF A THREE-DIGIT NU~1BER.
TRY TO GUESS"
:110 PRINT "t1'r' NUr'1E:EP AND I "lILL GIVE VOU CLUES AS FOLLOHS
:1213 PRINT"
PICO
- emE DIGIT CORRECT 8UT IN THE "mONG POSITION"
110 PRINT"
FERMI
- ONE DIOIT CORRECT mw IN THE RIGHT POSITION"
140 PRINT
BAGLES - NO DIGITS C()~~RECT"
150 FOR 1=1 .TO 3:

;;:-55
:26(1
270
280
2:::5
290
295

WOULD 'T'OU LIKE THE FWLES

:f:*:+:

? 57::3

PICO PICO
957
PICO FEf<:MI
GUESS :It 6" ? 75(1
PICO
CiUE5S :It 7 ? 985
l.~OU GOT IT!!!
GUESS # ':5 ?

~1Y

NU~1BER

~H1S

":tee*A(j.)':"10*AG~)+ACD

?~J0

PLR'r' AGAIN CT'ES OR rW)? '1'ES

630 PRINT "TRY GUESSING A THREE-OUJIT NU~18ER. ": GOTO 230
65~3 PRINT "OH ..
I FORGOT TO TELL 'r'ot) THAT THE Nu~mER I HAVE IN"
66121 PRINT "MIND HAS NO nw DIGITS THE ~~A~lE. ": GOTO ~~3ej
680 PRINT "YOU GOT IT!! !":PRINT
6913 ',.'='1'+1
",::'00 INPUT "PLAY AGAIN ('r'ES OR NO;' ".; A$
~?20 IF A$="'T'E5" THEN 156
7313 IF ¥=I) THEN 750
740 PRINT'PRINT "A"Y"- POINT SAGLES BUFF!!"
",:'50 PR I NT "HOPE YOU HAD FUN.
BY'E."
999 EtiD

O. f(.
HAVE A NUt48ER
GUESS -#
? :121

IN tlIN!).

PJCO
GUESS 4t
? 145
BAGLES
-~) 267
tJlJESS -#
PICa
G.lJESS 4* 4 ? 176

BAGLES
GUESS '"' 5 ?

PEAD'r'

89:~

FERrll FE,"lI
(lUESS '"' 6" ?

802

PICO FERt11
GUESS :# 7 ?
YOU

~392

GOT IT!!!

PLA'.,' . AGR I N ('1'ES OR NO)? NO
t1 5 - POINT 8AGLES BUFF!!
HOPE YOU HAD FUN.
B';'E.
READY

23

BANNER

PRINTS A LARGE BANNER

Description
This program creates a large banner on a terminal of any
message you input (up to 54 characters in length). The
letters may be any dimension you wish although the letter
height plus distance from left-hand side should not exceed
6 inches. Also, the letter height should be somewhat more
than the width. Adhering to these rules will generally produce
a very attractive banner.
computer Limitations
BANNER was written for a DIGITAL EduSystem 50. For other
computers, the character string line input (LINPUT) statement
at Line 240 would have to be changed.
Program Author
Daniel R. Vernon
Butler Senior High School
Butler, PA 16001

24

PROGRAM LISTING
IBB
110

120

RE~
RE~
RE~
RE~

PROGRAM WRITTEN BY DANIEL R, VERNON
SENIOR AT BUTLER SENIOR HIGH SCHOOL
BUTLER, PENNSYLVANIA !S001
OATE. 2I117l
COMPUTER SUPERVISION. MR, WILLIAM ELLIS
COMPUTER TOPICS INSTRUCTION- HR, ALBERT SUWART

130
14B RE~
150 REM
161 REM
THIS PROGRAM IS DESIGNED TO CREATE POSTERS
I" REM
180 REM
190 DIMGI(6), HI (6),
(9), G(e), A(U)
20B PRINT"IN~UT HUGHTM, ~IDTH IN INCH!S'I\IN~UTL,R\S'I\"R.2\C'A
210 PRINT"HOW ~AR, IN INCHES FROM THE LEn HAND SlOE, DO YOU WANT TO PLACE'
220 PRINT"TH! LETTUS. "INPUTS\S'IZ.'
230 PRINT"INPUT MUSAGE HERE"
248 LINPUT8S( II ,BI (2), 8S (3) ,BI (41, B1(5) ,8$ (5), es (1) ,BS(8) ,81(9)
250 FORx.nOUTEP-1 \CHANGES. (X) TOAVORY.I T08\A (X'6-hy).A (Y) \NEXTY\NEXTX
250 FORX'IT06\READHI(Xl\NEXTX\MI.HI(L)"OSUB U0
270 F.'. I \IF A
.BTHENU0\G(0l.L \fORX'1 T05\G( X).A (F) \NfXTX\CHANGEGTOG,
280 fORX'1 T06\G(0)oX,CHANGEGTOGI (X) \NHTX
290 FORX'I TOA/2\PRINT\NEXTX
300 IF' (F) . . 6THENS4s\ IF A(F) .3eTHEN990\IF A(F) .32TMEN63I\IF. (F)C48THEN210
305 IFA (F) >S1THENJIB\ONA (F) .41;OT0500, H0, 620, U5, 635, 55e, 61 e, 605, 595,585
310 IF A(F) ce5THENZ1e\IF A(F) .'9THEN330
320 DNA (F ).64GOT0350, 360,310,380,398,400,4 U, 430,440,450,460,470,480,490,500
330 IH.9mTHENZ10\ONA (F) -19GOT05 10,520,540,550, e60, 570;580,590,600,610,520
340 GOT0271
345 FORXOI TOAVRINTTAB (5), GI, GI\NEXTX\GOT027m
350 GOSUBU0\GOSUB890\GOSU8540\GOTOZ'0
350 GOSUBU0\GOSUB6S0\A.t _, e\GOSUBU0\4.t \GOSUB810\GOT0210
370 GOSUBe40\GOSUB1e0\GOSue'00\GOT0270
3B0 GOSUU4B\GOSUB100\A oC., 5\GOSUBe.0\A.C \GOSUS840\ GOT0270
390 GOSUB640\GOSUB6S0\GOSUBes0\ GOT0270
430 GOSUBU0\GOSUBe90\GOSUBe90\GOTOZ70
410 GOSUB640\Aot.,1S\GOSUB700\AoC.,2S\GOSUB650\A'C\GOSUB16e
420 AoCo,2S\GOSUB7I0\A_C\GOT0270
430 GOSUB640\GOSUB710\GOSUB640\GOT0270
440 GOSUe640\GOT0270
450 GOSUB750\GOSUe'40\GOSUB640\GOTOZ,e
460 GOSUBU0\GOSUes60\GOT0270
470 GOSUB540\GOSUB7 40\GOSUB' 40\ GOTOZ10
4 B0 GOSU B64 0 \ GO SUB e 9 0 \ GOS U888 0\ GO SUB 6 4 0\ GO T0 2 7 0
490 GOSU8640\GOSUB890\GOSUBU8\GOT0210
500 GOSUB640\GOSUB100\GOSUB640\GOTOZ'0
510 GOSUe640\GOSUB690\GOSUB19Z\GOTOZ10
520 GOSUB640\ UC., 1S\G.OSUB 700\4 0 ,2SoC\GOSU8650\A 0 C\GOSUB64 0
530 AOC.,2S\GOSUB710\A'C\GOT0270
540 GOaUB64 0\GOSUBe90\A.C •• S\GOSUBU0\GOSUB8I0\A.C \ GOT0270
550 GOlUB 770\GOSUB6S0\GOSUB760\GOT0270
se0 GOSUB7 80\GOSUB840\GOSUB7U\ GOTO 210
570 GOSUB640\GOSU" 40\ GOSUB640\GOT02'0
SBe GOSUB890\GOSU8880\GOT021a
585 GOSUB'90\ GOSUBe90\GOSU8640\GOT 0270
590 GOSUB640\GOSUB880\GOSUBS90\GOSUe640\GOT0270
595 GOSUBe40\GOSUB650\GOSUB640\GOT0270
600 GOSUS900\GOT02'0
805 GOSUB,S0\GOSUB'S0\GOSUB640\GOT02'0
810 GOSUS9'0\GOSUS800\GOSU8980\GOTOa10
615 GOSUS640\GOSUB650\GOSUB760\GOT0270
620 GOSUB920\GOT0270
625 GOSUB100\ GOSUB650\A.C *. s\GOSUBU0\A.C \GOSU8810\ GOT0210
630 GOSUB940\GOT02'0
635 GOSUB190\GOSUB' \0\ GOSUB640\GOT0270
649 FORU I TOA \PRINTT 4S es), \FO~xol TO 10\PR INTGI, \NEXTX\P~ INT\~EXTY\RETURN
650 IF ACI THEN660\GOT0810
86e LETA. I
670 FOU'I TOA\PR INTT AS (5) ,Gu Gil HI' HU Gil GSI HSI HSI Gil G$\NUTX\RETURN
680 PRINTTAB(SII
800 FOAX'I TOAVRINTT A8 e4.LOS) 'GU Gil Mil HII Gil GI\NEXTX\RnURN
'00 FORXol TOA\PRINTT AB (5)' Gu Gs "PRI NTHB e 8.L.Sll GS' GS\NEXTX\RETURN
'10 IFAcITHEN120\GOT0130
720 LETA'I
730 fORX'1 ToA\PR INTTAS (4'L 08)1 Gil GS\NEXTX\RETURN
140 FORXOI TOA\PR I NTT AB (S)' GIIGS\NEXTX\RETURN
'50 FORxol TOA\PRINTT AS (S), Gil GUGSI GS\NEXTX\RETURN
750 FORY'I TOA \PRINTTAB e 8), GS, GSI G$, Gil Gil GS I HII HS, Gil Gs\NEXTY\RETURN
770 FORXol TOAVR INTT AB (5), Gil Gil Mil HS, GI/ Gil Gil Gil Gil GS\NUTX\RETURN
780 FORX'I TOA\PRINTTAS (SOLOS) 'Gil G"NEXTX\RETURN
790 FORX'I TOA\PR INTTAS (4*L.S) 'GIIGSI GS/ Gil GU GS\NEXTX\RETURN
800 FORXol TOA \PR INTTAB (S " GSI GUGII Gil Gil Gs\NUTX\RETURN
810 FORX>! TOt/2\PRINTT AB (S)' \FORro! T02\FORZol TO (hL) .X\PRINTGI (I) I\NEXTZ
820 IFX.3THEN950\V>X
830 PRI NTH. ca.v) "~EXTY\PRINT\NEXTX\R!TURN
840 FORX>I TOCI2\PRINTTAB (5)' HI (X) ,VORY,I TOIBoL- (2.X "PRINTGI (I) "~EXTY\PRINT
85m NEXTX\RETURN
sem FOR X.40L T07.LSTEP 14.V (c.e) \PRINTT A8 (X.S), Gil Gil 01'
871 PRINTTAB('OL-X.Sl,GI/U,GS\NEXT X\RETURN
880 FORx.noe.LSTEPS.L/C\PRINTT AB (X-S I '.GSI GS, GS, GI\NEXTX\RETURN
890 FORX -S.L T00$TEP.e.L/C\PRI NTTAS (he), GS/ GS ,GS' GS\NEXTX\RETURN
900 FORx>no,oLSTEP (I40L) I (C.S) \PR INTT U (XOSl' Gil Gil Gil
910 PRINTT AB a'LoXo", Gil Gil GS\NEXT X\RETURN
920 FORx.nO'.L5TEP (7oL) I (C'3) \PR INTT AS (5)' GU Gil TAB ex-s " Gil GS/GII
930 PRINTUB (hLoS)' GIIGS\NExrx\RETURN
UB FORX'I TOAo3\PRINT\NEXTX\RETURN
950 FORW.! TOX.3\PRINT·
• I\NEXTW\ V'l\GOT0830
960 FORx.40L T01.L5TEPL 04/C\PRINTT AB (~.S) 'Gil Gil GI\NEXTX\RETURN
9'0 FOR Xo70L T04.LSTEP.4'L/C \PRINTTAB (XOS) 'GI, GI' GS\NEXTX\RETURN

as

(n

980 DATA.

M," It,"

.. ,.

",I'

","

",'"

990 FORX.ITOC*l\PRINT\NEXTX
1000 END

SAMPLE RUN

~g~t1~A~~I ~~T7~c~i~T~F~~ ~~~H~~;! lJa~ND
T:-IE

LETTE~S?

INPUT

~E5SAGE

$1 DE ..

DO YOU VANT TO PLACE

1

HEnE

? EuU 9

25

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEtEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEE'sEEEEEEEEEEEEEEEEEEEEE£EEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEE2EEE
EEEEEEEE
EEE£EEEE
EEEEEEEE
EEEEEEEE
EE2EEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEEEEEEE
EEE.EEEEE
EEEEEEEE
EEEEEEEE

DDDDDDDDDDDDDDDDD[:DDDDDDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DDDDDDDD:CDD[!DDDDDDDDDDDD[!DDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDDDC'OODDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDC'L'DDDDDDGDDDDDDDDDDDDDDD
DDDDIJDDr::.DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DCDDDDDD
DDDDDDDL
DDDDDDDD
DDLDDDDD
DDDDDDDD
DDDDDDDD
DLDDDDDD
LLDDDDDD
DDDDDDDD
DDDDDDLD
LDDDDDDO
DDDDDDDD
DDDDDLDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDD
DDDDDDDDD.DODDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDLDDDDDDDDDDDDLDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDDDL-DDDDDDDDDDD-ODD

PUUUUUUUUUVUUUUUUUUUUUUUCUUUUUTJUVUUUUUUU
uvuut:UUUUUUUD1JUUUUUUUUUVUUUUUUUUUUUUUUUU
utJUUlJUIJC'C'UUUUUUUUUUVUTJUuutJuuuueucruuuuuuu
UUUUUUtJU1JUVUUUL'VUUUUUUl1UUUUUuuuuuuuuuuuu
UllUIJUUtII)UUUUUUIJUl:t'UtJUUl..'fJUUUUUUUUUUUUUUUU
UUU{;UUuuuuuueuuuuut'UUUUUUUUUUUUUUIJUUUVUU
UUUl)UUUU
1JUUUUUlllJ
UUllUUlIUU
t!':UUUUUU
IJUUUUUUU
TjUV1JutJuu
UIJUL'u:rutJum;uut'C'uUVUUUUUUUUUUU!JUUUUUUUUUU
euuvucIJUUUUUIJUUUVU'JUUuut:UUUlJUUUUUUUUUUUU
t'UUUl!UUl'UUUUtfUUUTJU!.:U,UUU!Juuuuuuuum:uuuuuu
llUUUTJUUUUTJUUUUUuuuuUUUUUC'IJUUUUUUUUUUUUUU
lYUUtf'(IUUt;UU1JCUUt.!ljUUCUUUUlJUUUUUUUUUDUUUUUU
UUTJutnJUcuuuUuuuuuutJuuuuuutJUUUTJUUlJtiUTJUUUU

999999999999999999999999
999999999999999999999999
999999999999999999999999
999999999999999999999999
999999999999999999999999
999999999999999999999999
99999999
99999999
99999999
99999999
99999999
99999999
99999999
99999999
99999999
99999999
99999999
99999999
9999999999999999999999999999999999999999
9999999999999999999999999999999999999999
9999999999999999 9999 ~ 99 99 9 99 99999 99 999 9 9
9999999999999999999999999999999999999999
9999999999999999999999999999999999999999
9999999999999999999999999999999999999999

BASEBL

BASEBALL GAME

Description
This is a simulation of a nine-inning baseball game with you
controlling the pitcher when your team has the field and
controlling the batter when you are up to bat. The simulation
stops at nine innings, hence, it may be a tie game: however,
that has proved to occur remarkably few times.
computer Limitations
The game published was written for DIGITAL EduSystem 15/30/35
and actually consists of two programs, one which prints the
rules chained to the second program which plays the game.
IINOLINE II must be given before running to prevent overflow.
Other BASIC compilers will require conversion of the alphabetic
string input statements to a compatible format.
Source
Another version of baseball was submitted for Timeshared-8
by Jeff Moskow.and Brad Golden of Lexington High School.
This is available from DECUS as BASIC 8-562. A second version
was submitted by another Lexington High School student, Les
Servie. A FORTRAN version was submitted by David Benepe of
Fort Worth, Texas. These versions are not printed herein.
Jack Huisman
Oregon Museum of Science and Industry
Portland, Oregon
97200

26

PROGRAM LISTING
BASBAI.

EOUSVSTEM-35

510
520
530
540
550
5&0
570
580
590
b00
bl0

GOT0410
LEU'9*RNO (bl \ I PS 1'0THEN530\PR I NT"MY SA TTER" I\GOT0540
PRINT"YOUR BATTER'"
IFA>1 THEN550\PRINT" L.INEO OUT TO THE THIRD BASEMAN, "\GOT0840
IfA>2THEN5b0VRINT" POpPED OUT IN SHAI.1.0W I.EFT,"\GOT0840
IF A.3THEN580
PRINT" GROUNDED TO THE PITCHER"I\GOT0590
IfA.4THENb80\PRINT" GROUNDEO TO SHORTSTOP'"
PRINT" WHO THREW OUT THE MAN"I\IFC3'2THENb70
IfB 1'0lHENb70\ IfB2 0BTHENb30\ IfB3.0THENbi!0\PR INT" FORCED HOME,"
GOT0850
~20 PRINT" fORCED TO THI~D, "\GOT0850
&30 LETA I.INTC3.RND (0)) \PRINT" fOR CEO TO SECOND" " I f Ale.1 THEN&50

1000IMT(50).C(l9).FCI9).z(19)
I U FORX"I TCI9\PEAOC (X). Z (X). F (X) \NEXTX\I.ETXal
120 PRINT"WELCOME TO HUISMAN STADIUM FOR TODAV'S GREAT GAME BETWEEN"
130 PRINT"THE PDP-8 PANTHERS AND (YOUR NAME PLEASE) THE" I
140 FOR hI TO 99\INPUT U(A)\IF TCA)-141 THEN 150\NEXT A
150 I.ETT=A\PRINT\PRINT"A HIGHI.Y PARTISAN CROWD OP,
1&0 FORA=I TOT\\.ETS02*RND (0) \NEXTA
170 LET AoINT(1000~*RND(lll\PRINTA'
180 PRINT"FANS IS ANXIOUSLV AWAITING THE"\PRINT"START OF THE GAME."
190 PRINT"HERE IS MV TEAMI"."ANO HERE IS VOURS'"
200 PRINT"NAME", "AVERAGE", "NAME", "AVERAGE"

210
220
230
240
250
200
270
280
290

PRINT"-.-.", 11 . . . . . . . _ ... 11 ," • • • "'", " __ ......... "
GOSUB 400
PRINT\PRINT
PRINT"THE PANTHERS ARE TAKING THE FIELD NOW AS ANDREWS OF THE"
FOR A=I TO T-I\PRINT CHRSCT(A» I\NEXT A
PRINT" ADVANCES TO THE PLATE, PLEASE WAIT AS THE COMPUTER SINGS"
PRINT"OUR NATIONAL ANTHEM TO ITSELf" 2 OR 3 TIMESl JUST SING"
PRINT"ALONG UNTIL ASKED FOR yOUR PI.AV,"\PRINT
GOT0580

&40 F'RINTII.II\GOT0850

b50 PRINT\PRINT"AND THEN TO FIRST FOR A

300 DATA,215, ,412001, .05, .02, .2&3001, .03
31121 OATA"'1I02~ .236001, ,02, ,03, ,31&001, ".01

3812! OATA,03, .238001, .01, .03, .2310~1 ,,,,.02
390 DATA 0,21,0

"00 PR INT" HUI SMAN". Z (I) • "KLOOS". Z (2)
I

Z ( 3)

, "ANDREWS" I Z (4)

421£1 PRINT"S.ACCUSI!, Z (5) ,"MAYE~" I Z (8)
430 PR tNT" SMIHP', Z (7) , II HANSEN ",2 (6)

440
450
4b0
470
480
4'10

500
510
5<0
530
540
550
560
570

PRINT" SCHNE IOER" • Z (9) • "M ICHEL". Z (10)
PRINT"ROSENBAUM".Zelll."p, D. PEATE".Z(l2)
PR INT "POULSEN". Z (13) • "w ILlIAMS". Z (14'
PRINT"K ILGOUR". Z C! 5) • "NELSON". Z (lb)
PRINT "JOHNSON".Z(l7)."ANKCORN".Z(l8l
PRII'IIT"WMITNEY'I," MANAGE~","IVEY",t' MlNAGER"\PRINT
PRINT"PlTCHER'S OPTIONS ARE'''\PRINT''FAST8ALL''
PR I NT" BEANS'I.L" \ PR I NT "BRUSHSACK" \PR I NT" BA~~" \PR I NT "CURVE"
PR INT" SLIDER" \PR INT "KNUCKLE" \PR I NT"GREASEBAU (I1.i.EGAl.)"
PRINT"SPlTBALI. (!UEGA~) "\PRINT"CHECK"\PRINT
PRINT"BATTER'S OPTIONS ARE: n\PRINT"BUNT"\PRINT"SWING"
PR INTIIH IT-AWAY II, PR 1NT II SACRI F I CE II \PRI NT "GROUNDER II \PR I NT "fl YII
PRINT"KILL"\PRINT
RETURN

580 CHAIN"BASBL1

11

5q0 END

6AS8LI

EOUSYSTE~-35

100
110
120
130
140
150
Ib0
170
180
\ q0

DIMB(lbl
lETZ(0)'.5\LETZ',5
i.ETl'1
LE TB lo0\L.ETB2·0\LETB300\LETlI=0\i.E Tl2a0\L.ETI 3.0
L.ETClc0\LETC2=0\PRINT
IFC2 e .4THENI60\PRINT"THE BATH_R WALKS."\GOSUaQ20\GOTOI40
IfCI<>3THENI80\PRINT"THE BATTER STRUCK OUT,"\LET C3.CHI\GOTOI40
If SI=ITHEN\80\I.ETXoX+\
IfC3e3THEN270\lfS 10\ THENI90\LETSlol \GOT0200
PR I NT" AFTER" 1 IJ "INNINGS'" \LET 101 + I \LETS 100
2Q10 PRINTI2;"RUNS,";I11"HITS,",13: II ERRORS AND"1B1+B2+B3'''LEFT ON SASE."
210 If I =5THEN 1420\ IF S 1=0THEN230\PR I NT" t to M"I \GQT0240

220
230
240
250
2b0

I fS 1=0THEN230\PR I NT" I' M" J\GOT024~
PR I NT" VOU' RE'"
PRINT" UP NOW."\PRINT"SCOREI ME",S21"YOU",S3
PRI~T\LETC3=0

GOTOl30

270 PRINT"YOUR PLAY? I';

280
290
300
310
320
330
340
350
3b0
37 0
380
390
400
410
"20
430
440
"50
460
"70
480
"90
500

PLAY I"

700 IFhbTHEN880\PRINT" HIT TO LEFT fIELD FOR AN OUT,"
710 IFC3=2TMEN840\ I fB I +Bi!+B300TMEN840
720 PRINT"THE MAN ON",\IFB3'ITHEN730\lfBa.1THEN750\GOT0790
730 PRINT" THIRO MADE IT MOME."J\GOSUB930\LET83.0
740 IFB2=0THEN780
750 PRINT" SECOND"I\IfAla0TMEN7b0\PRINT" STAVED PUT,""OT07B0
7&0 IFAI.ITHEN770\PRINT" MADE IT TO THIRO,"\~ETB3'I'LETB2_0\GOT0780
770 PRINT" .AS OUT TRYING TO TAKE THIRO."\LETC3=C3+I\LETB2=2
780 IFBI<>I THENe40
790 IFB2e.1THEN800\pRINT" FIRST STUC~."\GOT0840
800 PRINT" ON flRST" J\IFB2<>2THEN820
810 PRINT" MADE IT TO SECONO,"\LETB2 a l\LETBI-0\GOT0840
820 LETW'2*RNO (0)' IfW.1 THEN810\PRINT" WAS OUT GOING, "\LETC1-C3+1
830 I.ETB2.0
840 I.ETZ (vl sZ (V), (Z (y) 1100l\GOT08b0
850LETZ(Y)=zeV)+(Z(V)/100)
8b0 LETC3 oC3+I\PR!NT"THAT WAS OUT N~MSER"'C3
870 GOTOl2b0
880 IFA.7THEN8Q0\PRINT" "IT OVER THE PITCHER'S HEAD FOR A"I\GOTOqI0
890 IfA>8THEN900\PRINT" ~IT THROUGH THE HOLE INTO RIGt;T FOR A" I\GOTOQI0'
Q00 PRINT" MIT INTO LEFT FIELD FOR A'"
910 IFZ.hOTHEN 1210\ I FZ>3*OTHEN 1130\ IFZ'2-DIHEN 1040\PR I NT" 5 I NG> E,'
920 IF B 3 =0 THE "910 \ GO SUB9 30 \ LET e3 -0 \GOT 091>0
930 IF S I-I THEN940\I.E T53.S3+ I \GOT0950
940 LETS2=S2+1
950 LETI2=I2+1 \~ETURN
9b0 PRINT"THE MAN ON THIRD SCORED,"
970 IFB2=0THENI000\PRINT"THE MAN ON SE'COND"J\lfA'8THENQ90\PRINT" SCORED,"
Qe0 GOSUB930\I.ETB2.0\GOTOI000
990 PRINT" WENT TO THIRO,"\I.ETB2'0\~ETB3=1
1000 IF61*0T~ENI030\PRINT"THE MAN ON fIRST"J\lfA.8THENI020
1010 IFC2.4THENI 020\LETB 1*0\GOT0990
1020 PRINT" TO SECOND,"\I.ETB2ol
1030 l.ETSI=I\GOTOI240
10401,ETW-3_RNO(0l\IFW>\THENI050\PRINT"N OFF THE .AI.I."I
1050 IFA2=\THENI0b0\PRINT" STAND UP"I
101>0 PRINT" DOU8LE,"\IfB3=0THENI080\PRINT"THE MAN ON THIRO SCOREO."
1070 GOSUB930\L.ETB3 a 0
1080 IFS2=0THENI090\PRINT"THE MAN ON SECOND SCORED. "\GOSUS930\LETB<=0
1090 IFBI=0THENI120\PRINT"THE MAN ON FIRST"I\IfA>8THENII10\PRINT" SCORED."
1100 GOSUB930\I.ETB! =0\GOTO 1120
1110 PRINT" WENT TO THIRD,"\LE! 81=0\\.EI63=1
1120 LETB2=! \GOT0I2"0
1130 PR I NT" TR IPI.E 1" \LETA3-e I +82+S3\ IF A3=0T~ENI200\PR I NT" THE MAN ON'"
1140 IFBlo0THENI150\PRINT" nRST" I\GOSUSQ30
1150 IFB2=0THENII70\IFBI=0THENllb0\PRINT". AND",
I !b0 PRINT" SECOND" 1 \GOSUB930
1170 IFB3=0THENII90\ IFBI+B2a0THEN 1180\PR I NT". ANO'"
1180 PRINT" THIRO""GOSU8930
1190 PRINT" SCORED," \I.ET8 1=0\I.E162=0
1200 I.ETB3*I\GOTOI2"0
1210 IFB1+B2+B3<3THENI220\PRINT" GRAND SI.AM"I
1220 PRINT" HOME RUNll"\FORAI'ITO(BI+S2+81+ll\GOSUS930\NEXTAI
1230 LETS 1=0\I.E1Baa0\l.ET63-0
1240 IFC2.4THENI2b0\I.ETZ e noz (Y) + (Z (V) 1100)
1250LETtI'Il+l
1260 RETURN
1270 PRINT"PITCkER THROWN OUT fOR T~ROWING ILLEGAL PITCH,"\GOT0270
I <80 LEU- 50RNO (0l\ If Ae3THEN I 320
1290 IFA>4THEN1300\PRINT"INSIOE - "J\GOTOI3l0
1300 PRINT"OUTSIOE • '"
1310 LETC2 -C2+ I \PR I NT" BAl.I." 1C2\GOTO 150
1320 IFZ (V) eOTHENI3"0\GOSIolB520\IFAebTHENI330\I.ETC (VlaC eV).1 \GOT01"0
1330 i.ETC(V).C(Y)"I\GOTOI"0
1340 LETC tV)-C (n-I \LETB-3.RNO (7)
1350 IF6.1 THENl3b0\PRINT"A SWING & A MISS. "J\GOT01H0
13&0 IF8.~THENI380\PRINT"INSIDE CORNER - CAU "I
1370 GOTOl390
1380 PRINT"~OUl.l " "I\IFCI=2THENI400
1390 LETC1'CI+I\PRINT" STRIKE"IC1\GOTOI50
1400 PRINT"COUNT STAYS AT",ca,"BALI.S ANO"ICIJ
1410 PRINT"STRIKES,"\GOTOI50
1420 PRINT"fINA" SCORE I ME"IS21"YOU"IS3
1430 IFS2>S3THENI450\ I F S3'S2THENI440\PR I NT 'VOU WON," \GOTO 14b0
1440 PRINT"A DRAWl "\GOTOI4b0
'
1450 PRINT"I WONl"
1"&21 CHAIN"DEMON "
1470 END

320 OATA,01, ,241001, .03, .02, .32112101, ,02
330 DATA- ,02, • 3b7001, ,02, -,02, ,38601211, ",.01
340 DATA,01, ,295001, .03,~,01, .296001, ,02
350 DATA· .02, .319001, ,02, ... 02, .285001, ,02
3&121 DATA".03, .2950"'1, .1211, ~02, .29S0iH, ,03
370 0"'T,6.,02, .218001, .02, .02, • 13 cH,'J01 ,-,02

4 UI PR INT 'I HOEREN"

~OUBLE

bb0 LETC3=C3+\\LET8100\GOT0840
670 PRI~T" AT fIRST, "\GOTOB~0
b80 IFA.5TMEN700\PRINT" HIT A PLoV INTO DEEP CENTER WHERE IT WAS",
bq0 PR I NT" CAUGHT," \GOTO' 10

FOR A=I T020\ I NPUlSe eA) \ IF B (A )'141 THEN290\NEXH
LETO=I*RNO(5)\PRINT
l.ETC=100*SO)+B(2)\IF SI'0THEN420
IFC<>19713THEN320\I.ETO=0+C (X) \GOTD 12B0
IfCe.1 q993THEN330\LETD*O+F (X) \GOTO 1280
IFC'19597THENI280
IFCoI9&10THENI280
IfC=21104THEN1280
IFC02050bTHENI280
IFC'.20110THEN380\ IFO'. aTHEN I 280\GOTO I 210
IFCe.21308 THEN3q0\ IFO<, 8THEN 1280\GOTO 1270
IFCe.19700THEN400\PR I NT "RUNNERS ARE STICK I NG." \GOT0270
IFCe.1 9593THEN410\PR INT"MY BA HER" J\GOT01300
FORAI'ATOA-! \PRINTeHRS (6 (AI) l J\NEXTAI \PRINT"?" \GOT0270
IFCe.19b !3THEN"30\PR INT" YOUR 8A TTER" 1 \GOSU8570\GOTO 140
IfC a 21315THEN1280
IFCc>19700THEN450\PRINT"CHEtK NOT YET IN,"\GOT0270
IFC=20a0ITHENI280
IFCC.21312THEN470\PRINT"STEAI. NOT YET IN,"\GOT0270
IFC=2IZ93THENI280
IFC=20110T"ENI<80
!fC'20004THENI280
IFCoi0501 THENI<80

27

SAMPLE RUN
RU'"
"ASE9L

01.38 P"I

16-MAY-73

'NELCOMF.: TO HUI SMA~ StADIU:'tf FOR TODAY'S GREAT GAMF.:
THE PDP-6 PA>lTHERS

YOUR PLAY? KILL
INSIDE - BALL 3
YOUR PLAY? S"'ING
INSIDE - BALL 2
YOUR PLAY? KILL
INSIDE CORNER - CALL
STRIKE 1
YOUR' PLAY? HIT-AWAY
FOUL I STRIKE 2
YOUR PLAY? BUNT
YOUR BATTER 'GROUNDED TO THE PITCHER WHO THREW OUT THE MAN AT FIRST.
T HAT WAS OUT NUMBER 1

A~D

(YOUR

~A"lE

Rl!:Tw~EN

PLEAS;:' THE? RSTS/F. ROCIrr.TS

A HIGHLY PAilTISM CROWD OF 53971 FMJS IS A'JXIOUSLY A;;AITI"!G T;rE
START OF THE GAME.
HERE IS MY TEAM'
A~D ~ERE IS YOURS,

NAME

AVERAGE

HUISMA"!
HOEHEN'
BACCUS
SMITH
SCflNEIDER
ROSEr-IBAUM

.412001
• 236001
.241001
.367001
.295001
.319001

POULSE~

.295eJ01

KILGOUR
JOHI\ISON
'HITNEY

.216001
.236001
MANAGER

NA!'vJE

AVERAGE

.316001

NJA'iER

.36~001

HANSEN

.321001
• 29f.t?l01
.2650'01
.295001
.139001
.231001
MANL\(:;ER

MICi-{~L

P. D. PEATE
WILLIAMS
NF.LSO'"
AN'{COR!'l
IVEY

YOUR PLAY? BUNT
YOUR BATTER GROUNDED TO THE PITCHER WHO THREW OUT THE MAN AT FIRST •
THAT WAS OUT NUMBER 2

.2~3001

,(LOOS
,ANDREWS

YOUR- PLAy? S"'ING
INSIDE CORNER - CALL
STRIKE 1
YOUR PLAY? SWING
OUTSIDE - BALL 1
YOUR PLAY? KILL
OUTSIDE - BALL 2
YOUR PLAY? GROUNFDER
INSIDE - BALL 3
YOUR PLAY? GROUNDER
YOUR BATTER LINED OUT TO THE ,THIRD BASEMAN.
THAT WAS OUT NUMBER 3

PITCHER '5 OPTIO!'llS ARE:
FASTBALL
BEANBALL
BRUSfl13ACK
BALL
CURVE
SLIDER
KNUCKLE

o

SCORE. ME 0 YOU 0

GREASEqALt. CI LLEGAt..)
SPITBALL CILLEGAL'
CHECK
BATTER'S OPTIONS ARE:
BU!'lT
SwING
HIT-A1>AY
SA,CRIFICE
G.fiQUNIJER.
FLY
'{ILL

THE ?Af\lT1-fERS ARE TA~ING TI-IE. FIRLD N'OW AS A~DR~WS OF TH~

RSTS/E HOCI{ETS ADVANCES TO T,~ PLATF.:.
Pt.1O';ASE Wtl.IT AS rqR COMPUTJ;;R '51"r5
lm ,NATIQ"IJAL ANT'iEM TO ITSELF - 2 OR 3 TIMES!
JUST SIl\JG
ALONG UNTI L ASl{ED FOR YOUR PLAY.
YOUR P!.AY? SWING
YOUR BATTER GROUNDED TO SHORTSTOP WHO THREW OUT THE MAN AT FIRST.
~AT

WAS OUT NUMBER 1

YOUR PLAY? SW ING
INSIDE -

BALL 1

YOUR PLAY? SWING
INSIDE -

BALL 2

YOUR PLAY? HIT-AWAY
INSIDE CORNER - CALL
STRIKE
YOUR PLAY? KILL
INSIDE CORNER - CALL
STRIKE 2
YOUR PLAY? KILL
YOUR BATTER HIT TO LEFT FIELD FOR AN OUT.
THAT WAS OUT NUMBER 2
YOUR PLAY? SWING
OUTSIDE - BALL 1
YOUR PLAY? KILL
OUTSIDE I BALL 2

YOUR PLAY? HIT-AWAY
YOUR BATTER POPPED OUT
THAT WAS OUT NUMBER 3

o

IN SHALLOW LEFT.

RUNS .. !tJ HITS .. 0 ERRORS AND 0 LEFT ON BASE.

I'M UP NOW.
SCORE.

ME 0 YOU 0

YOUR PLAY? FASTBALL
MY BATTER HIT THROUGH THE HOLE INTO RIGHT FOR A SINGLE.
YOUR PLAY? FASTBALL
MY BATTER GROUNDED TO THE PITCHER WHO THREW OUT THE MAN FORCED TO SECOND
"'D THEN TO FIRST FOR A DOUBLE PLAYI
THAT WAS OUT NUMBER 2
YOUR PLAY? CURVE
MY BATTER HIT TO LEFT FIELD FOR AN OUT.
THAT WAS OUT NUMBER 3
AFTER 1 INN INGS 0 RUNS",

1 HI T5 ... 0 ERRORS AND 0 LEFT ON BASE.

\QUIRE UP NOW.
SCORE.

RUNS .. 0 HITS ..

I'M UP NOW.

ME0 YOU 0

28

(21

ERRORS AND 0 LEFT ON BASE.

BASKET

BASKETBALL GAME VS DARTMOUTH

Description
This program simulates a game of basketball between Dartmouth
College and an opponent of your choice. You are the Dartmouth
captain and control the type of shot and defense during the
course of the game.
There are four types of shots: 1. Long Jump Shot (30 ft.),
2. Short Jump Shot (15 ft.), 3. Lay Up, and 4. Set Shot.
Both teams use the same defense, but you may call it: Press (6),
Man-to-man (6.5), Zone (7), or None (7.5). To change defense,
type "0" as your next shot.
Note: The game is biased slightly in favor of Dartmouth. The
average probability of a Dartmouth shot being good is 62.95%
compared to a probability of 61.85% for their opponent.
(This makes the sample run somewhat remarkable in that Cornell
won by a score of 51 to 35. Hooray for the Big Red!)
Program Author
Basketball programs were received from B.ill Heuer, Fort Worth,
Texas; James Bonalumi, Torrington, Conn.; and Alan Segal,
Roslyn, New York. The one published was written by a thensophomore at Dartmouth in the Class of '70:
Charles R. Bacheller
Dartmouth College
Hanover, NH 03755

29

PROGRAM LISTING
5 RANDOMIZE
18 PRINT "THIS IS DARTMOUTH COLLEGE BASKETBALL, YOU WILL BE DARTMOUTH"
2. PRINT" CAPTAIN AND PLAYMAKtB, CALL SHOTS AS FOLLOWS. I, LONG"
30 PRINT
D0 FT,) JUMP 8HOT. 2 SHORT [15 rT,) JUMP SHOTI 3, LAY"
40 PRINT
UP, 4, SET SHOT,"
60 PRINT "BOTH TEAMS WILL USE THE SAME DEfENSE, CALL DEfENSE AS"
78PRINT" FOLLOWS. 6 PRESS,
6,5 MAN-TO-MAN,
7 ZONE I
7.5 NONE,'72 PRINT" TO CHANGE DEFENSE, JUST TYPE
0
AS YOUR NEXT SHOT,'
74 PRINT "YOUR STARTING DEFENSE WILL BE",

76

l~PUT

0

77 IF D<6 THEN 2010
79 PRINT
80 PRINT "CHOOSE YOUR OPPONENT" I
82 INPUT D'
U0 PRINT "CENTER JUMP"
390 IF RND > 3/5 THEN 420
400 PRINT OS," CONTROLS THE TAP,"
410 GO 'XO l000
420 PRINT "DARTMOUTH CONTROll5 THE TAP."
425 PRINT
430 PRINT "YOUR SHOT"I
435 LET P-0
440 INPUT Z
445 If Z<'INT(Z) THEN 455
446IF ASS(Z-Z»2 THEN 455
447 GOTO 460
455 PRINT "INCORRECT ANSWER.
Rnne IT",
456 COTO 440
460 GO TO 470
470 IF RND <.5 THEN 1000
480 If 1<100 THEN 1000
490 PRINT
491 IF S(1)OS(0) THtH 510
493 PRINT

495
496
497
498
499
500

PRI~T

'I

*****

END

I!

*****

END Ot~ GAME

or

SF-CONe HALf

1130 PRINt

*****"

"REBOU~D

TO "rO$,"."

GO TO 3000
IF RND>.40 THEN 1158
GO TO 1300
IF D~6 THEN 5100
PRINT "BALL PASSED BACK TO You. ",
GO TO 430
IF RND',9THENI190
PRIN! "PLAYER FOULED. TWO SHOTS."
GOSUS 4000
GO TO 3000

1190

P~INT

"BALL STOLEN, "IOSI"IS

B~LL.p

1195 GO TO 30~0
1200 IF RND'.782*D/8 THEN 12S0
1210 PRINT "SHOT IS SLaCKED.
BALL CONTROLLED BY",
1230 IF RND>.S THEN 1242
1235 PRINT" DARTMOUTH,"
1240 GO TO 430
1242 PR.INT " II,OS,","
1245 GO TO 3000
1250 If RND>.843*D/8 THEN 1270
1255 PRINT "SHOOTER IS FOULED,
TWO SHOTS,"
1260 GOSUS 4000
1265 GO TO 3000
1270 PRINT "CHARGING FOUL.
DARTMOUTH LOSES THE BALL,"
1280 GO TO 3000
1300 LET T-1+ 1
1301 IF T050 THEN 8000
1302 IF T-92 THEN \304
1303 GO TO 1l0S
1304 GOSUS 600
1305 IF Z00 THEN 2010
1310 IF Z>3 THEN 1700
1320 PlUNT "LAY UP."
1330 IF 7/D*RND'.4 THEN 1360
1340 PRINT "SHOT IS GOOD.
TWO ~OINTS."
134~ GOSUB 7000
1355CO TO 3000
U60 IF 7/D*RND'.7 iHEN 1500
1370 PRINT "SHOT IS orr THE RIM."
1180 IF RND>2/3 THEN 1415
1390 PRINT OS I" CONTROLS THE RI.4 THEN 1440
1430 GO TO 1300
1440 PRINT "BALL PASSED .BACK TO YOU." I
1450 GO TO 430
1500 IF 7/D*RIID>.875 THEN 1600
TWO SHOTS.'
1510 PRINT 'SHOOTER rOULED.
1520 GOSUB 4000
1530 GO TO 1000
1600 IF 7/D*RND>.925 THEN 1630
1610 PRINT "SHOt BLOCKED. "O'J"IS BAL"."

1700
1710
2.010
2020
2010
2040
3000
3005
3008
]010

PRINT
aD TO
PRINT
lNPUT

DARTMOUTH LOSES THE BALL,'

"S!;T SHOT"
1330
"YOUR· NEW DEFENSIVE ALLIGN.MENT IS",

D
If 0<6 TIIEN 2.10

GO TO· 425
LEt pol

0',"

*****:'1

515 PRINT "FINAl. SCOREI DARTMOUTH" SCI) lOS" "S(0)
520 STOP
600 PRINT
610 PRINT' *** TWO MINUTES LEFT IN THE GAME ***"
520 PRINT
630 RETURN
1000 If Z-I THEN 1040
1020 IF Z-2 THEN 1040
1036 GO TO !l00
1040 L1:T ToT+1
1041 IF T-S0 THEN 8000
1042 IF T 0 92 THEN 104.
1043 GO TO 1050
1046 GOSUB 600
1050 PRINT "JUMP SHOT"
1060 IF RNO >.141*D/8 THEN 1090
1010 PRINT "SHOt IS GOOD."
1075 COSUS 7000
1085 CO TO 3000
1090 IF RND >.682*D/8 THEN 1200
1100 PRINT "SHOT IS orr TARGET."
1105 IF D/6_RND>.45 THEN 1130
1110 P~INT 'DARTMOUTH CONTROLS rH~ RE80UND,"
1120 GO TO 1145
1137
1145
1150
1158
1160
1170
1180
1185
1187
1188

1820 GO TO 3000
~~I~~ ;;:~RGn!G rOUL,

LET T-To\
Ir T=54 THEN 8000
llI' T_92 THEN ]015
]012 GO TO 3018
3015 GOSUS 600
l018 PRINT
]020 LET ZI-10/4_RNDol
3030 IF ZI>2 THEN 3500
l040PRINT "JUMP SHOT"
3050 II" 8/0*IIND>,3S. THEN )100
3060 PRINT "SHOT IS GOOD."
3080 Goaus 6000
3090 GO TO 425
3100 IF S/D-RND>.75 THEN 3200
3105 PRINT "SHOT IS orF THE RIM."
3110 IF D/6-RND>.S THEN liS.
l120 PRINT "DARTMOUTH CONTROLS THE REBOUND."
UJ0 GO TO 425
3150 PRINT O.~" CONTROLS THE RESOUND."
3160 IF Da6 THEN 5000
3155 IF RND>.S THEN 3175
lI68 PRINT "PASS BACK TO "
GUARD.'
] j 70 GO TO 3000
3175 GO TO 3500
3200 If 8/D*RND>,9 THEN 3310
3210 PRINT "P~AYE~ FOULED.
TWO SHOTS."
3220 GOSUS 4000
1230 GO TO 425
3310 PRIWT 'OFFENSIVE rOUL. DARTMOUTH'S BALL"
3320 GO TO 425
3500 IF ZI.3 THEN 3800
3510 PRINT "LAY UP"
1520 II" 71D-RND>,413 THEN lU0
3530 PRINT "SHOT 15 GOOD."
l540 GOSUS 6000
3550 GO TO 42.
3600 PRINT "SHOT IS MISSED,'
l610 GO TO 31U
3800 PRINT "SET SHOT"
)8\0 GO TO 3530
4000 REM .rOUL SHOOTING*
4010 IF RND>.49 THEN 40.0
4020 PRINT "SHOOnR MAKES BOTH SHUTS,"
4030 LET SII-P)=S[1-P)+2
4040 GOllUS 6010
4041 RETURN
4050 IF RND'.75 THEN 4100
4060 PRINT "SHOOTER MAKES ONE SHOT AND MISSES ONE,"
4070 LET S(1-P)cS[1-P)ol
4080 GO TO 4040
4100 PRINT "BOTH SHOTS MISSED."
UI0 GO TO 4040
5000 IF RND>. 75 THEN 5010
500. GO TO 31b5
5010 PRINT "BALL STOLEN.
EASY J..AY-UP FOR DARTMOUT~,"
~u 5 GOSUS 7000
5030 GO TO 3000
5100 IF RND'.6 THEN 5120
5110 GO TO 1160
5120 PRINT "PASS STOLEN BY "IOSI" EASY LAI-UP,"
5130 GOSUS 6000
5140 GO TO 425
6000 LET 8(0)a810)+2
6010 PRINT "SCORE I " SCI!I "TO ., 5(0)
6020 RETURN
7000 LET S(I)"S(1)+2
7010 GOSUS 6010
7020 RET-URN
8000 PRINT"
***** END OF FIRST HALF ***n"
8010 PRINT"SCORE' DARTMOUTH" 5(1), OS" "S(0)
8015 PRINT
8016 PRINT
8020 GO TO 370
9999 E'ID

"SCORE AT END OF REGUJ..ATION TWE I"
PRINT"
DARTMOUTH" 5(1), OS" "5(0)
PRINT
PRINT "BEGIN TWO MINUTE OVERTIME PERIOD"
LET T-93
GO TO 370

510 PRINT

m:

30

SAMPLE RUN
THIS IS DARTMOUTH COLLEGE BASKETBALL.
"'OU WILL BE DARTMOUTH
CAPTAIN AND PLA"'i'lAKER.
CALL SHOTS AS FOLLOWS:
1. LONG
<30 FT. ) JUi'lP SHOT; 2 SHORT (13 FT. ) JUMP SHOT; 3. LA ...
UP; 4. SET SHOT.
BOTH TEAMS 101 I LL USE THE SAME DEFENSE. CALL DEFENSE AS
FOLLOWS: 6 PRESS;
6. 5 MAN-TO-MAN;
7 ZONE;
7. 5 NONE.
TO CHANGE DEFENSE, JUST T ... PE
0
AS ...OUR NEXT SHOT.
YOUR STARTING DEFENSE WILL BE 77
CHOOSE YOUR OPPONENT ?CORNELL
CENTER JUMP
CORNI!LL CONTROLS THE TAP.
LAY UP
SHOT I S GOOD.
SCORE:
9 TO

2

LAY UP
SHOT 15 MISSED.
CORNELL CONTROLS THE REBOUND.
LAY UP
SHOT 15 MISSED.
DARTi'lOUTH CONTROLS THE REBOUND.

4

YOUR SHOT ?1
JUMP SHOT
SHOT I S BLOCKED.

YOUR SHOT ?1

.....

BALL. CONTROLLED B~' DARTMOUTH.

6

TWO MINUTES LEFT I N THE GAI'IE

JUI'IPSHOT
SHOT I S GOOD.
SCORE:
11 TO

43

LAY UP
SHOT 15 GOOD.
SCORE :. 31 TO

45

YOUR SHOT n
LAY UP.
SHOT I S GOOD.
SCORE:
n TO

TWO POINTS.
45

SET SHOT
SHOT I $ GOOD.
SCORE:
n TO

47

8

YOUR SHOT ?2
JUMP SHOT
SHOT IS OFF TARGET.
REBOUND TO CORNELL.
,LAY UP
SHOT IS MISSED.
DARTMOUTH CONTROLS THE REBOUND.

SET SHOT
,
SHOT I S GOOD.
SCORE:
33 TO

49

YOUR SHOT ?3
LAY UP. .
sHIn I S GOOD.
SCORE: .35 TO

TWO PO I NTS.
49

SET SHOT
SHOT ISM I SSED.
CORNELL CONTROLS THE REBOUND.
PASS BACK TO CORNELL GUARD.

YOUR SHOT ?1
JUMP SHOT
SHOT 15 GOOD.
SCORE:
12 TO

8

LAY UP
SHOT IS GOOD.
SCORE:
12 TO

JUMP SHOT
SHOT I S GOOD.
SCORE:
35 TO

19

YOUR SHOT ?1

51

***.* END o~ GAME *****

YOUR SHOT ?2
JUMP SHOT
SHOT I S OFF TARGET.
DARTMOUTH CONTROLS THE REBOUND.
BALL PASSED BACK TO YOU. YOUR SHOT 74
SET SHOT
SHOT IS OFF THE RIM.
CORNELL CONTROLS THE REBOUND.

FINAL SCORE: DARTMOUTH 35 CORNELL

LAY UP
SHOT IS MISsED.
CORNELL CONTROLS THE REBOUND.
PASS BACK TO CORNELL GUARD.

12

CORNELL'S BALL.

***

'lOUR SHOT ?1
JUMP SHOT
SHOT IS OFF TARGET.
DARTMOUTH CONTROLS THE REBOUND.
LAY UP.
SHOT IS OFF THE RIM.
DARTMOUTH CONTROLS THE REBOUND.
LAY UP.
SHOT IS OFF THE RIM.
CORNELL CONTROLS THE REBOUND.

MISSED.
CONTROLS THE REBOUND.

YOUR SHOT ?3
LAY UP.
SHOT BLOCKED.

BALL CONTROLLED BY CORNELL.

JUMP SHOT
SHOT IS OFF THE RIM.
DARTMOUTH CONTROLS THE REBOUND.

YOUR SHOT ?4
SET SHOT
SHOT 15 OFF THE RIM.
DARTf10UTH CONTROLS THE REBOUND.
BALL PASSED BACK TO "'OU .... OUR SHOT 73
LAY UP.
SHOT IS OFF THE RIM.
DARTf10UTH CONTROLS THE REBOUND.
LAY UP.
SHOT I S GOOD.
TWO PO I NTS.
SCORE:
18 TO 6

JUf1P SHOT
SHOT I S GOOD ..
SCORE:
12 TO

43

2

YOUR SHOT ?2
JUMP SHOT
SHill I S BLOCKED.
YOUR SHOT ?1
JUMP SHOT
SHOT I S GOOD.
SCORE:
8 TO 4

GOOD.
18 TO

41

JUMP SHOT
SHOT IS OFF THE RIM.
CORNELL CONTROLS THE REBOUND.
PASS BACK TO CORNELL GUARD.

SET SHOT
SHOT ISM I ssm.
DARTMOUTH CONTROLS THE REBOUND.

LAY UP
SHOT IS
CORNELL
LAY UP
'SHOT I S
SCORE:

GOOD.
29 TO

YOUR SHOT 14
SET SHOT
SHOT IS OFF THE RIM.
CORNELL CONTROLS THE REBOUND.

YOUR SHOT 71
JUMP SHOT
SHOT IS OFF TARGET.
D,ARTf10UTH CONTROLS THE REBOUND.
BALL PASSED BACK TO "'OU. ...OUR SHOT 72
JUHP SHOT
SHOT I S GOOD.
SCORE:
6 TO 4

SET SHOT
SHOT 15 GOOD.
SCORE:
8 TO

MISSED.
CONTROLS THE REBOUND.

LAY UP
SHOT 15 GOOD.
SCORE:
29 TO

SET SHOT
SHOT IS MISSED.
DARTMOUTH CONTROLS THE REBOUND.

JUMP SHOT
SHOT I S GOOD.
SCORE:
4 TO

LAY 'UP
SHot IS
CORNELL
LAY UP
SHOT 15
SCORE:

YOUR SHOT ?2
JUMP SHOT
SHOT 15 OFF TARGET.
REBOUND TO CORNELL.

YOUR SHOT ?2
JUMP SHOT
BALL CONTROLLED BY DARTMOUTH.
SHOT IS BLOCKED.
YOUR SHOT ?3
LAY UP.
SHOT IS GOOD.
TWO POINTS.
SCORE:
2 TO 2

~OUR SHOT ?2
JUMP SHOT
SHOT I S GOOD.
SCORE:
4 TO

JUMP SHOT
SHOT I S OFF TARGET.
DARTMOUTH CONtROLS THE REBOUND.
LAY UP.
SHOT :is GOOD.
TWO POINTS.
SCORE:
29, TO· 39

31

51

BATNUM

BATTLE OF NUMBERS

Description
The game starts with an imaginary pile of objects, coins for
example. You and your opponent (the computer) alternately
remove objects from the pile. You specify in advance the
minimum and maximum number of objects that can be taken on
each turn. You also specify in advance how winning is
defined: 1. To take the last object or 2. To avoid taking
the last object. You may also determine whether you or the
computer go first.
The strategy of this game is based on modulo arithmetic.
If
the maximum number of objects a player may remove in a turn
is M, then to gain a winning position a player at the end of
his turn must leave a stack of 1 modulo (M+l) coins. If you
don't understand this, play 23 Matches (23 MTCH) first, then
BATNUM, and just have fun!
Program Author
BATNUM is based on an old game similar to NIM. Its adaptation
for the computer appears to originally be by the daddy of
BASIC:
John Kemeny
Dartmouth College
Hanover, NH 03755

a3

:!:!o

~u

..

~"C

Q)

:..

c:

~~

:..E

.0'"
I:

I!!

8~

~

______________________________________________

32

~

~=
:00
'" ()
0
::J

PROGRAM LISTING

SAMPLE RUN

110
120
130
140
150
169
179
180
290
219
220
230
240
339
349
350
360
370
380

THIS PROGRRM IS A 'BATTLE OF NUMBERS'
GAME. WHERE THE COMPUTER IS ... OUR OPPONENT.

3~0

400
410
420
430
440
450
460
479
489
4~9

509
519
520
530
549
559
569
579
580
590
600
619
629
639
640
650
660
679
689
6~0

790
710
720
730
740
750

PRINT "THIS PROGRAM IS A 'BATTLE OF NUMBERS'"
PRINT"GAME, WHERE THE COMPUTER IS YOUR OPPONENT. "
PRINT
PRINT"THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU AND"
PRINT"YOUR OPPONENT ALTERNATLY REMOVE OBJECTS FROM THE PILE. "
PRINT"WIN.NING 15 DEFINED IN AD~'ANCE AS TAKING THE LAST OBJECT"
PRINT"OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINNING"
PRINT"CONDITIONS. DON'T USE ZERO, HOWEVER, IN PLAYING THE GAME.
PRINT
GOTO 330
FOR 1=1 TO 10
PRINT
NEXT I
PRINT"ENTER PILE SIZE:";
INPUT N
IF N()0 THEN 370
GOTO 330
IF N()INT(N) THEN 220
IF N(1 THEN 220
PRINT "ENTER WIN OPTION - 1 TO TAKE LAST, ;;: TO AVOID LAST: ";
INPUT M
IF 1'1=1 THEN 430
IF 1'102 THEN 390
PRINT "ENTER "IN AND MAX: ';
I NPUT A, a
IF A)a THEN 430
IF A(1 THEN 430
IF A()INT(A) THEN 439
IF a()INT(B) THEN 430
PRINT"ENTER START OPTION - 1 COMPUTER FIRST, 2 ,'OU FIRST:";
INPUT S
IF 5=1 THEN 530
IF S()2 THEN 4~0
LET C=R+B
IF. S-2 THEN 570
GOSUS 600
IF W=1 THEN 220
GOSUB 810
IF W=1 THEN 220
GO TO 550
LET Q=N
IF 1'1=1 THEN 630
LET Q=Q-1
IF 1'1=1 THEN 680
IF N)A THEN 720
LET W=1
PRINT"COMF'UTER TAKES"; Ni "AND LOSES. "
RETURN
IF N)B THEN 720
LET W=1
PRINT"COMPUTER TAKES" i Ni "AND WINS. "
RETURN
LET P=Q-C*INT(Q/C)
IF P)=A THEN 750
LET P=A
IF P<=B THEN 770

THE GAME STARTS WITH AN ASSUMED PILE OF
YOUR OPPONENT AL TERNRTLY REMOVE OBJECTS
WINNING IS DEFINED IN ADVANCE AS TAKING
OR NOT. YOU CAN ALSO SPECIFY SOME OTHER
CONDITIONS. DOW T USE ZERO, HOWEVER, IN

OBJECTS. YOU AND
FROM THE PI LE.
THE LAST OBJECT
BEGINNING
PLRYING THE GAME.

ENTER PILE SIZE: 123
ENTER WIN OPTION - 1 TO TAKE LAST, <: TO AVOID LAST:
?2
ENTER MIN AND MAX:
71,3
ENTER START OPTI-DN - 1 COMPUTER FIRST, <: ,'OU FIRST: ?2
YOUR MOVE:
12
COMPUTER TAKES l' AND LEAVES 20
YOUR MOVE:
?3
COMPUTER TAKES 1 AND LEAYES 16
YOUR'MOYE :
?3
COMPUTER TAKES 1 AND LEAVES 12
YOUR MOVE:
13
COMPUTER TAKES 1 AND LEAYES 8
YOUR MOVE:
?3
COMPUTER TAKES 1 RND LEAYES 4
YOUR MOVE:
13
COMPUTER TAKES
RND LOSES.

ENTER PILE SIZE: 723
ENTER WIN OPTION - 1 TO TRKE LAST, 2 TO AYOID LRST:
ENTER MIN AND MAX:
71,3
ENTER START OPTI ON - 1 COMPUTER FIRST, 2 YOU FIRST:
COMPUTER TAKES 2 AND LEAVES 21
YOUR MOVE:
13
COMPUTER TAKES 1 AND LEAVES 17
YOUR MOVE:
?2
COMPUTER TAKES 2 AND LEAVES 13
YOUR MOVE:
71
COMPUTER TAKES 3 AND LEAVES 9
YOUR MOVE:
71
COMPUTER TAKES 3 AND LEAVES 5
YOUR MOYE:
?3
COMPUTER TAKES 1 AND LEAVES 1
YOUR MOYE:
71
TOUGH LUCK, YOU LOSE.

?2

n

760 LET P=B
770
789
790
800
810
820
839
848
850
860
879
880
890

LET N=N-P
PRINT"COMPUTER TRKES" i Pi "RND LEAI/ES' iN
LET W=0
RETURN
PRINT " ...OUR MOYE: ";
INPUT'P
IF P00 THEN 870
PRINT"I TOLD YOU NOT TO USE ZERO ... COMPUTER WINS BY FORFEIT.•
LET W=1
RETURN
IF P()INT(P) THEN ~20
IF P)=A THEN ~10
IF P=N THEN ~60
~09 GO TO 920
~10 IF P(=B THEN ~40
929 PR I NT "I LLEGAL MOYE, REENTER IT: .. i
~30 GO TO 820
940 LET N=N-P
950 IF Noe THEN 1030
~60 IF 1'1=1 THEN 1000
970 PRINT"TOUGH LUCK, YOU LOSE. "
~80 LET W=1
990 RETURN
100e PRINT"CONGRATULATIONS, YOU WIN ...
1018 LET W=1
1920 RETURN
1030 IF N)=0 THEN 1060
1040 LET N=N+P
1850 ao TO ~20
1960 LET W=0
1079 RETURN
1080 END

33

ENTER PILE SIZE: ?27
ENTER WI N OPTI ON - 1 TO TAKE LAST, 2 TO AYe I D LAST:
?1
ENTER MIN AND MAX:
71,4
ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST: ?2
"'OUR MOVE:
?2
COMPUTER TAKES 1 AND LEAYES 24
YOUR HOVE:
74
COMPUTER TAKES 1 AND LEAYES 1~
YOUR MOVE:
74
COMPUTER TRKES
AND LEAI'ES 14
YOUR MOVE:
14
COMPUTER TAKES 1 AND LEAYES ~
YOUR MOVE:
14
COMPUTER TAKES
AND LEAYES 4
"'OUR MOVE:
74
CONGRATULATI ONS, YOU WIN.

BATTLE

NAVAL SHIP BATTLE

Description
This description is an adaptation of the one written by Ray
Westergard, the program author.
"BATTLE is based on the popular game Battleship which is
primarily played to familiarize people with the location
and designation of points on a coordinate plane.
II

BATTLE first randomly sets up the bad guys I fleet disposition
on a 6 by 6 matrix or grid. The fleet consists of six ships:
Two destroyers (ships number 1 and 2) which are two units long,
two cruisers (ships number 3 and 4) which are three units long
and two aircraft carriers (ships number 5 and 6) which are
four units long. The program then prints out this fleet disposition in a coded or disguised format (see the sample computer print-out). You then proceed to sink the various ships
by typing in the coordinates (two digits, each from 1 to 6,
separated by a comma) of the place where you want to drop a
bomb, if you I 11 excuse the expression. The computer gives
the appropriate responses (splash, hit, etc.) which you should
record on a 6 by 6 matrix. You are thus building a representation of the actual fleet disposition which you will hopefully
use to decode the coded fleet disposition printed out by the
computer. Each time a ship is sunk, the computer prints out
which ships have been sunk so far and also gives you a
"SPLASH/HIT RATIO".
The first thing you should learn is how to locate and designate
positions on the matrix, and specifically the difference between
"3,4" and "4,3". Our method corresponds to the location of
points on the coordinate plane rather than the location of
numbers in a standard algebraic matrix: The first number gives
the column counting from left to'right and the second number
gives the row counting from bottom to top.
The second thing you should learn about is the splash/hit ratio.
"What is a ratio?" A good reply is "Itls a fraction or quotient.
Specifically, the splash/hit ratio is the number of splashes
divided by the number of hits.
If you had 9 splashes and 15
hits, the ratio would be 9/15 or 3/5, both of which are correct.
The computer would give this splash/hit ratio as .6.
One of the main objects and primary educational benefits of
BATTLE comes from attempting to decode the bad guys I fleet
disposition code. To do this, you must make a COMPARISON
between the coded matrix and the actual matrix which you construct as you play the game.
Program
Ray Westergard
Lawrence Hall of Science
University of California
Berkeley, CA 94700

34

II

PROGRAM LISTING
10
20
30
40
50
60
70
80
90
100

11m

120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
2g0

300
310
320
330
340
350
360
37 0
380
390
400
410
420
430
440
450
460
470
480
490
500
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730
740
750
760
770
780
790
800
810
820
830

840
850
860
870
880
890
900
910

92 0
g30

940
950
960
970
ge0

990
1000
1010
1020
1030
1040
1050
1060
1070
10S0
10 90
1100
1110
1120
1130
1140
1150
1160

REM -- BATTlE WRITTEN ~Y RAy WESTERGARD 10170
REM COPyRIGHT 1971 Sy THE REGENTS OF THE UNlv. OF CALIF.
RE~ PRODUCED AT THE lAWRENCE HAlL OF SCIENCE, BER~ElEy
DIM F E6,61,H E6,61,A E41,8 E41,C E61,l E31
MAT FoZER
FOR 101 TO 3
N.4.1
FOR Jol TO 2
AoINT(6· RND(01'·1
eo INT(6*RNOC0' '+1
OoINTC4.RNOC0".1
IF F EA,Bl >0 THEN 90
M00
GOTO D OF 150,340,550,740
8 EI] -S
B (2] oS [3]-7
FOR K_l TO N
IF M>I THEN 240
IF B [Kl06 THEN 230
IF F[A,BEK1+I]>0 THEN 230
B EK+Il-B [Kl+\
GO TO 280
M02
Zo((BEI] HIN B(2]] MIN 8(31)
IF zo I THEN 9~
IF F!A.Z-I]>0 THI'N 90
BEK.IloZ-1
NEXT K
F(A,Bl_9"2*I",J
FOR KOl TO N
F [A,B EK+lll'F [A,B]
NEXT K
GOTO 99~
A [11 'A
6[11 0 8
A (210A [310S [21,S [3].0
FOR ~01 TO N
IF H>I THEN 460
IF A(Kl'l OR B[Klol THEN 450
IF FEAEK,-l,8[Kl-lp0 THEN 450
IF F[A[~1'I,B[~1l>0 AND F[A[~I-I.B[~II'F[AEK1,~[~I-ll TH!',N 450
A E~+Il'A [,Kl-l
B [K+lloS [Kl-I
GOTO 530
H02
ZloCCAEI] MAX AE21) MAX A[311
Z2' CCB [I] MAX B E2] I MAX S [3] I
IF ZloS O~ Z2 0 S THEN 90
IF F[ZI.I,z2+ll>~ TMEN 90
IF F[ZI,Z2.1]>~ AND F[ZI,Z2+ll-F[ZI+I.Z21 TMEN 90
A [.+1] -ZI+I
B E.+\loZ2.1
NEXT K
GO TO 950
A Ell-A
A [21 'A E31'7
FOR .01 TO N
IF M>I THEN 640
IF A EK1-S THEN 630
IF F[A[Kl+I.Bl>0 THEN 630
A [X.IloA [Kl+1
GOTO 680
"02
Z'CCAtI] MIN A[21' MIN A[3])
IF Z'I THEN 90
IF FEZ-I,Bl>0 THEN 90
A [~+Il-Z-1
NEXT K
F tA,Bl-9-2,d .. J
FOR X=I TO N
F [,A EX+Il ,8] OF [A,Bl
NEXT K
GOTO 990

1170
1180
1190
1200
1210
1220
1230
1240
1250
1260
\270
1280
1290
1300
1310
1320
1330

PRINT "START GAME"
INPUT X,V
IF XCI ORX>6 OR INT(x,#AB5(xl THEN 1210
tFY'0 AND y c 7 AND INT(YloABs(y, THEN 1230
PR1Nt "INVAlID INPUT. TRY A~UN."
GO TO 1180
.07.Y
CoX
IF F ER,CI >0 THEN 1290
5 0 5+1
PRINT "SPLASHI
TRY AGAIN."
GOTO 1180
IF C[F[R,CllC4 THEN 13~0
PRINT "THERE USED TO BE A SHIP AT THAT POINT, SUT YOU SUNK IT,"
PRINT "SPlASHI TRY AGAIN."
sos+1
GO TO 1180
If H ER,el.0 THEN 1420
HoH+1
H[R,Cl-FER,el
PRINT "A DIRECT HIT ON SHIP NUHBER"'FER,Cl
C [F ER,C] laC EF ER.Cll+1
IF C EF CR,Cll >- 4 THEN 1470
PRINT "TRY AGAIN,"
GOTD 1180
PRINT 'yOU HAVE ALREADy PUT A HOlE IN SHIP NUMBER"IFtR,el'
PRINT "AT THAT P'OINT."
PRINT "SplASH I TRV AGAIN."
S"S+I
GO TO 1180
L tINT((F ER,Cl-I,/2,+lloL {INT( (F [R,C] -1)/2,011+1
PRINT "AND YOU SUNK IT. HURRAH FOR THE GOOD GUYS."
PRINT 'SO FAR THE BAD GUVS HAVE LOST'
PRINT L(U ,'OESTROYER(sl.
"llt2! ,"CRUISERCS]. AND '"
PRINT lo[3] '''A!RCRAf"T CARRIER(S,."
PRINT 'YOUR CURRENT SPLASHIHIT RATIO IS-,S/M
IF CL [!l.l [21+l (3] 1 c6 THEN 1180
PRINT
PRINT "YOU HAVE TOTAL.LY wIPED OUT THE BAD GuVS' FlEET"
PRINT "wITH A FINAL. SPLASH/HIT RATIO OF'ISIH
IF S/H>0 THEN 1590
PRINT "CONGRATUI.ATIONS .- A DIRECT HIT EVERy TIME,"
PRINT
PRINT K• • • • • • • • • • • • • • • • • • • »
PRINT
GOTD 50
END

13~0

1350
1360
1370
1380
1390
1400
1410
1420
1~30

1440
1450
1~60

1470
1480
14g0
1500
1510
1520
1530
1540
1550
1560
1570
1580
1590

1600

1610
1620
1630

SAMPLE RUN
THE FOLLOWING CODE OF THE BAD GUY5~ FLEET C-ISPOSITION
HAS BEEN CAPTURED BUT NOT DECODEC1

o

o

6

6

2

5

5

5

o
DE-CODE IT AND USE IT IF YOU CAN
BUT KEEP THE DECOD1NG METHOD A 5EC~:ET
START nAI1E
?2,1

A EI] • A

SPLASH' TRY AGA I N,

B [1108
A121,A [3107
8 [2] oB [31 -0
FOR ~.I TO N
IF M>I .THEN 870
IF A EK1.6 OR 8 [Xlol THEN 86~
IF F[A[Kl+I,BE~1-ll>0 THEN 860
IFFEA[Kl+I'B[Xll>0 AND FIAEX1+I,B[XlloFEA[Xl.8{I(I-P THEN 860
A [X+!l0A [X] +1
8 EX+I] -S EX1.1
GO TO 940

?5,4

A DIRECT HIT ON SHIP NUMBER
TRY AnA Ill,
INVALID INPUT, TRY AGAIN,
?5,3
A DIRECT HIT ON SHIP NUMBER 5
TRy AGAIN,
?5,4
YOU HAVE ALREADY PUT A HOLE 1 N SH I P MUM8ER ";

.-2
ZI'CCAEll

RTo-THAT POINT.

SPLASH! TRY AGAIN.

?5,5

MIN AE2]) MIN A(3))
Z20(CB[1l MAX 8E2]) MAX B{3]]
IF ZI-I OR Z206 THEN 90
IF FtZI~I,z2+1]>0 THEN 9~
IF F[ZI,Z2+1l>0 ANDF{ZI,Z2+lloF[ZI-I,Z21 THEN 90
A EX+tl-Zt-1
8 EK+lloZ2+1
NEXT ~
F [A,Bl'9.2.I-J
FOR K-I TO N
F [A [K+Il,B [~+1l10F {A,Bl
NEXT K
NEXT J
NEXT I
PRINT
PRINT "THE FOLlOWING CODE O.F THE BAD GUYS' FLEET DISPOSITION"
PRINT "HAS BEEN CAPTURED BUT NOT DE-CODED I "
PRINT
HAT HOTRN(F,
MAT PRINT H'
PRINT
PRINT "DE-CODE IT AND USE IT IF YOli CAN"
PRINT "SUT KEEP THE DE-COOING METHOD A SECRET."
PRINT
MAT H-ZER
HAT I.0ZER
C [lloC [21-2
C E31 0 c [~lol
C [51 oC [61,0

A DIRECT HIT ON SHIP NUM8ER 5
TRY AGAIIl,
15,2
A D!RECT HIT ON SHIP NUMBER 5
AND YOU SUNK IT.

0-

HURRAH FOR THE GOO(;' GUY:::.

DESTROYEfHS),

er

CI<:UI::;ER 5) AN[)

50 FftR THE BfrD GU'r'S HA\o'E LOST
1
AIRCRAFT CA~:':IER(S),

YOU.: CUi\'RENT SF'LASH/HIT RATIO IS ,5
?L :t
A [)1RECT HIT ON SHIP NUM8ER

TRYAGAIIl,
?1'.2
A DIRECT HIT ON SHIP NUMBER 1
AND YOU SUNK I T.
1

HURRAH FOR THE GOO(;'

DESTROYEfHS),

I)

GU~IS~

CRUISEP(S) 'AND

SO FA,.: :THE E:RD GUY::: 'HFIVE_ LOST
1,

~

A1RCRAFT CARRIER(S),

YOUR CURRENT SPLASH/HIT RATIO IS .3::::n:J:,3:
16,1
SPLASH' TRY ABAI~
?1, 6

A DIRECT HIT ON SHIP NIJM8H: S
TRY AGAIN,
?2.1;5

A DIRECT HIT ON SHIP NUM8E.: ]:
TRY AGAI N,
13,6
A DIRECT HIT ON 5H1P NIJI1BER ]
AND YOU SUNK IT.

HURRAH FOR THE Goor· GU'r'S.

1
DESTROYER(S),
1
CRUISEfi:(S) ANI)
YOU CURRENT SPLASH/HIT RATIO 15 . ]:7-:;

S_M.0

35

SO FFr(.';: THE BAD GU'r'S HAVE LOST
1
AIRCf<:ftFT (:ARFdER(S),

BINGO

COMPUTER BINGO

Description
In this game you and the computer playa game of bingo. The
computer first generates a bingo' card for both you and itself.
It then spins the number drum and draws numbers at random
which it posts on lithe board.
It's up to you to play both
your card and the card of the computer (a second person can
play this card if you wish).
II

The computer checks for BINGO on both cards, so don't try to
cheat!
Source
Sorry folks -- the author and source are totally unknown.
It showed up on an in-plant DIGITAL DECsystem-lO quite
mysteriously one day last year.

BINGO BINGO BINGO
ct TO 111

10

(1.,0 SO)

~

,

131

to 411

.U 60.
TO

t.' to 7S)

(1. to IS)

11.'0301

Il' TO til

39 48 68

5

7 1 40 53 72

8

15 i

8

69

14 17

4

51 67
11
A1 5A 7A

48 72
40 50 67

12 18

1 ~ 5 31 57 69

30 44 4965

·HOA.I~ONTAL

(flOW)

)

~ ~

"ERTIC.~'- (C.OLUMN)

36

PROGRAM LISTING
100
120
180
190
200
210
220
235
240
250
260
270
280
290
300

310
320
330
]40
350
360
370
380
390
400
410
420
430
435
440

RANDOMIZE
PRINT"YOU ARE NOW GOING TO PLAY A COMPUTERIZED VERSION OF BINGO . . "
LET F.l
DIM 8(10,\0)
DIM L(75)
MAT R~AO AS(5)
DATA B ,I ,N ,G ,0
REM
THIS SEQUENCE GENERATES THE CARD NUMBERS (LINES 240.4301
FOR Klo! TO 75
LET L(Kl1'0
NEXT Kl
PRINT" II,"
H~REIS ".
IF F>1 THEN 310
PRINT"YOUR CARD"
GOTO 320
PRINT"MY CARD"
LET Mol6
LET GoP'.4
FOR YoF TO G
FOR xor TO G
LET RoYNT(M*RND)
IF R~ THEN 360
LET B(X,Y)"R
LET LCR)-1
NEXT X
LET MoM.1S
NEXT Y
RE1~
THIS SEQUENCE PRINTS THE CARD (LINES 440-b70)
PRINT

450 PRXNT " •• e•• II ,
460 FOR XoF TO G
47~

480
490
500
510
520
530
540
550
560
570
580
590
600

610
620
610
640
650

1450
1460
1470
1480

1490
1500
1510
1520
1530
1540
1550
1560
1570
1590
1600
1610
1615
1620
1630
1640
1650
1660
1&70
1680
1690
1700
17U
17l~

1'740
1750
1770
1775
1790

11 .... 1.""", 1I.·fol.·", 1t • • G•• II, 1t • • O-_"

PRINT
PRINT

179~
180~

PRI~T

FOR Y=F TO G
IF 8(XiY1.aCY.2,Y.2)
PRINT B(X,Y),
GOTO 550

THEN

540

PRINT"FR~~e:",

NEXT Y
NEXT X
PRINT
PRINT
PRINT
PRIN T II .. -_ ...... - ... - - . . . - - - _ . . . - - - .......... - - .. --~ - - _ .. - ...... - .. -_ ... - . - _ . . . . . . . . . - .. _ . - . . . . . . . ..
PRINT"
CTEAR OFF AFTER ~ACHINE AUTOMATICAtoLY ADVANCES PAPEk]"
FOR K9=1 TO 9
PRINT
NEXT K9If
THEN 680

f_'

660 T.ET F=6

670
680
690
700

710
720
730

740
750
760
770
780

GO TO 240
PRINT
PRINT"NOW WEIRE 'ALL SET TO Pt.AY THE GAME.
USE A PENCIL TO MARK Ot'F"
PRINT"THE NUMBERS ON YOUR CARD AS THEY ARE CALLED."
PRINT"
(PLEASE PLAY MY CARD AS WELL AS YOUR OWN)"
PRINT"***DON' T GET SMART,
I'LL BE PLAYING SOTH YOUR CARD un MINE"
PRINT"
UP HERE IN BOSTUN,
(SO THERE--)"
PRINT
PRINT "ARE YOU READY",
INPUT RS
IF RI<>"NO" THEN 82~
PRINT

190 PRINT"*********.HURRY UP:*********II
900
910
820
930
940
850
8b0
870
875
980
910
920
930
940
950
9b0

GOTO 740
REM
YOR Klal TO 75
LET L(Kll-~
NEX'! Kl
PRINT
LET B(3,3)=0
LET BC8,8)=0
REM THIS SEQUENCE GENERATES THE BINGO NUMBERS (LINES 880-1100)
LET U=INTC75*RNO).1
IF L(U)<>0 THEN 8a0
LET L(U)=1

y.,

a

X-,

1810
1820
1830
1840
1850
1860
1870
1890
1900
1910
1920
1950
1970
1980 PRINT

*

1990 PRINT"

******** •••

2130 PRINTII

lOU WIH .....

*

*"

IT's A TIE .*.********"

REM
THIS IS THE "PLAY AGAIN?' SEQUE~CE'
PP,INT
PRINT "DO YOU WAn TO PLAY AGAIN" I
INPUT ~$
202~ PRINT
2030 IF E$o"YE~" THEN 180
2040 STOP
2045 REM THIS IS THE "I wIN" SEQUENCE
2050 PRINT
2060 FOR Sol TO 6
2070 PRINT"I WIN,
'"
2090 NEXT S
2090 PRINT
2100 PRINT
2110 GOTO 200~
'211~ REM THIS IS THE "YOU WIN" SEQUF.NCE
2120 PRINT

1995
Z000
2010
2020

yoU

WI~

.......

YOU wIN ....... II

2140 GO'£O 2000
2145 REM THIS IS THE "EMO" 01' THE LIST OF PROGRUI ENTITLED "BINGO"

2150 E'W

P~INT

I f RNO > ,5 THEN 970
PRINT"THE NUMBER COMES UPI",
GOTO 980

970 PRINT"THE NEXT ONE 151",

980 PRINT AS(lNT(U-!l/15).11,U
1105 REM THIS IS THE "NUMBER ON CARD?" S~QUENCE (LINES 111~-12b0)
1110 rOR Y=1 TO 10
1120 FOR X.l TO 10
1130 IF ~CX,Y)=U THEN 1250
1140 NEXT X
1150 NEXT Y
1160 L.ET t'=1
1170 GOSUB 1270
1180 LET Ya6
1190 GOSUB 1270
1200 IF V=0 THEN 1230
1210 IF W=1 THE~ 1980
1220 GOTO 2050
1230 If' Wo0 THEN 880
1240 GOTO 2120
1250 LET S(X.Y)=0
1260 GOTO 1140
1265 REM THIS IS THE BINGO DgTERMINI~G SEQUENCE (LINES 127.-1950)
1266
1267 REM THIS IS THE VERtICAL CHECK FOR BINGO*** (LINES 1270-1430)
1270 LET GoY.4
1280 FOR yay TO G
1290 FOR XoF TO G
1300 IF B(X,Yl00 THEN 1430
1310 IF X0 THEN 1610
IF YCF+4 THEN 16~0
Ir, '-6 TKEN 1550
PRINT
PI\INT"YOUIVE aOT A
Ii I N
0 * * .. "
LET wal
RETURN
PRINT
PRINT"IIVE GOT A
BIN GO" * * • • "
LET Vol
GOTO 1620
NEXT Y
NEXT X
REM THIS IS THE SLANT CHECK CM'-I) FOR BINGO*** (LINES 1620.1770)
LET
LET Y.F
IF B(X,Y)C>0 THEN 1770
LET X.X.l
LET YoHI
IF YCF.5 THEN 1640
IF Yol1 THEN 1740
UT W.I
PRINT
PRINT"YOUIVE GOT A B
N G 0 * * ."
RETURN
PRINT"I'VB GOT A 8
N G 0
* *
LET Vol
REtURN
REM THIS IS THE SLANT CriECK (Mol) FOR BINGO**. (LINES 1780.1950)
LET xaF.4
LET YaX
IF B(X,Y)<>0 THEN 1950
LET XoX-l
LET yaHI
IF YCNS THEN 1900
IF Yol1 THtN 1900
PRINT
PRINTI''iOU'VE GOT A 8 I N GO • • • "
LET W=1
RETURN
PRINT
PRINT"I'VE 'GOT A 8 I N GO .. * * * ."
LET Vol
RETURN
REM THIS THE TIE PRINTOUT SEQUENCE

37

SAMPLE RUN
NOl4 14E'RE ALL SET TO PLAY THE GFIME.
USE A PENCIL TO MA.,K OFF
THE NUMBERS ON ,'OUR CARD AS THE,' A.,E CALLED.
(PLEASE PLAY MY CARD AS WELL AS ,'OU., OWN)
***DOWT GET SMART.
I'LL BE PLA,'ING BOTH ,'OU., [:A.,C' ANC' MINE
UP HERE IN BOSTON.
(50 THERE--)

YOU ARE NOW GOING TO PLA,' A COMPUTE.,IZED VERSION OF 8INGO-HE.,E' 5 ,'OUR CARD
'--8--

--1--

--N--

--6--

--0--

ARE YOU READY ?,'ES

19

50
THE NUMBER COMES UP:

22

G

THE NEXT ONE IS;

75

20

THE NDa ONE 15:
11

29

FREE

23

14

46

37

18

40

65

29

THE NEXT ONE 15:

B

6

THE rwr1BER COMES UP:

G

51

THE NUMBER COMES UP;

71

56

68

THE NUMBER COMES UP:

N

3:7

THE NEXT ONE 15:

G

59

THE NEXT ONE IS:

B

14

o

71

THE NEXT ONE IS;

o

62

THE NEXT ONE 15:

cr

7121

THE NEXT ONE IS;

N

36

THE NEXT ONE 15:

N

31

B

11

(I

66

THE NEXT ONE IS:

o

75

THE NEXT ONE IS;

E'

8

THE Nur18ER COMES UP:

N

3:8

THE NEXT ONE IS:

8

2

THE NUMBER COMES UF':

B

12

THE NEla ONE 15:
[TEAR OF.F AFTER MACH WE AUTOMAT! CALL Y

HERE~

'--B'--

--1--

A~'VANCE";

PAPER]

2:1.

THE NEXT ONE IS:

S M,' CA.,e,

--N--

THE NUf1BER COMES UP:

--·6--

--0--

THE NUMBER CQl1E5 UP:
THE NEXT ONE IS;

20

45

58

51

'rHE

NE~a

ONE IS;

THE NEXT ONE IS:
27

42

60

!'52

29

74

70

50

62

49

61

THE NUMBER COMES UP:

13

26

44

[TEAR OFF AFTm MACHINE AUTOMATICALL,' FI~'VANCE5 PAPER]

17

THE Nur1BER COMES UP:

N

45

THE NEXT ONE IS,

G

49

THE NIJI1BER COMES UP:

G

46

THE NEXT ONE 15:

Eo

5

THE NEla ONE 15:

o

72

THE NUMBER COMES UP:

B

1

YOU"VE GOT A

BIN GO*'

YOU WIN.

,'OU WIN. .

*' *'

00 YOU WANT TO PLAY AOAI N "'NO

38

,'OU WIN.

BLKJAK

GAME OF BLACKJACK

Description
This is a simulation of the game of blackjack or 21, Las Vegas
style. This is one of the more comprehensive versions of blackjack which allows splitting your hand if the first two cards·
are the same. Also, the dealer will ask for an insurance bet
if he has an exposed ace. The house limit is $500.00.
Source
A number of versions of this program were submitted.
Ira Gold-.
stein of Fort Worth, Texas, submitted a particularly interesting
version which uses a second chained program (DECK) to shuffle
the cards. Two versions are printed here -- one written anq
modified by a number of DIGITAL personnel for RSTS-ll and
another written by students at the Oregon Museum of Science
and Industry and slightly modified at DIGITAL.
BLKJAK:

BLKJAC:

Tom Kloos
Oregon MuseUm of Science
and Industry
Portland, Oregon 97200

Digital Equipment Corp.
Maynard, MA .01754

©

39

1967 by Creative Publications

PROGRAM LISTING

BLKJAC

10 ~RINT "DO YOU .A~T INSTRUCTIONS (IF SO TYPE A I)",
15 INPUT K
25 IF K<>I THEN 85
30
PRINT
PRINT
35
40
PRINT
45
PRINT
PRINT"THls IS A GAME OF BLACKJACK. ~AS· VEGAS. STY~E."
50
55
PRINT"HUE ARE THE RU~ES OF THE HOUSE.
THE DEALER"
60
PRINT"MUST HIT ON 16 OR ~ESS AND NI~~ STAY ON 17 OR"
55
PRINT'MORE.
YoU MAY SP~IT TWO CAROS IF THEY ARE THE"
A~SO,"
70
PRINT"SAME AND P~AY ONE HAND WITH EACH OF THE~.
t5
·PRINT'YOU ~AY DOU8~E YOUR BET AND RECEIVE EXACT~ Y ONE"
B0
PRINT"MORE CARD ANY TIME ON YOUR FIRST HIT.
THE TYPING"
85
PRINT"INSTRUCTIONS ARE' 0-NO HITI I-HITI 2-DOUR~E' AND"
90 PRINT "3-SP~IT A PAIR."
95 IF K<> I THEN 155
100
PRINT'WHEN TH~ OEA~ER HAS AN EXPOSED ACE HE WIL~ ASK"
US
PRINT"YOU FOR AN INSURANCE BET,
AN INSURANCE 8ET WI!.~"
110
PRINT"RISK HA~F YOUR 8ET FOR AN AMOUNT EQUAL TO YOUR BET"
115
PRINT'IF YOU WIN.
YOU WIN IF THE DEALER HAS A BLACKJACK'
120
PRINT"AND ~OSE IF HE DOESNIT.
THE HOUSE ~IMIT IS Sb00,00'
125
PRINT"GOOD ~UCK.
OH. 8y THE .Ay, THE DEA~ER IS NOT~D FO~"
130
p~INT"OEALlNG OFF THE BOTTOM OF THE DECK.
.ATCH HI~ VERY"
135
PRINT"C~OSE~V.
HERE HE IS Noo,'
1~0
PRINT
US
PRINT
150
PRINT

155

~ET

K.Z

~ET .1'0
155 RANDOMIZE
110 ~ET N'INT(1945*RNO(0).1)
175
PRINT
180
PRINT"ANV TIME YOU "ANT "~ TO RESHUFF~E THE CARDS SIMPLY"
185
PRINT"TYPE 7771 WHEN I ASK FOR YOUR W·AGER AND I'LL BE VE~Y"
In
PRINT"HAPPV TO Oe~IGE.
O,K,. HERE IS THE FIRST HAND."
200 ~ET ~'INTCl0.RND(0))
210 DIM DC52loE(5),V(b).T!S).w(5)
218
FOR A'I TO 52
220
~ET D!A).e
225
NEXT A
238
DIM Q(52)
235
FOR Aoe TO 39 STEP 13
240
FOR C'I TO 13
245
~ET QlAoC)'C
250
NEXT C
255
NExT A
250
PRINT
255
~ET K.K.,
210
FOR P'I TO 5
215
~ET UP).,
280
~ET VCPh0
285
LET TCP).e
290
N~XT P
29S
~fT V(3)'1
300
PRINT
305
PRINT
310
PRINT
315
PRINT"WAGER"'
320
~ET P'I
325
INPUT W
330
LET W(2).W
335
IF Hull THEN 1685
3~0
IF ... 500 THEN 310
3~5
IF W01177 THEN 380
350
GOSUB 1.45
355
GOT031s
360
PRINT"THAT' S TOO MUCH - HOUSE LIMIT 18 $500"
365
GOTO 315
310
PRINT
315 PRINT "I SHOW".
3U
GOSU8 865
385
IF E (1)'0 THEN 395
390
~ET V(~)'I
395
LET V(Shl
400
GOSUB 865
405
~ET M.X
4U
~ET P'2
415
PRINT"FIRST CARD 18",
~20
GOSue 865
428
~ET .'X
430
PRINT"NEXT CARD IS",
~35
GOSUB 865
4~0
If V (2) >0 THEN 605
445
~ET S'X
450
IF V(3) .. 1 THEN 605
455
IF T(P)c.21 THEN 50S
~50 PRINT"
"*B~ACKJACK."
465
PRINT
410
PRINT" THAT'S GETTING
81T RIDICuLOUSII""
415
PRINT
48B PRINT "My HO~E CARD "AS ".
485
~ET XIM
490
GDSUB 1035
495
~ET .1'.1.1.5 ...
500
GDSUB 1335
505
IF V(4)10 THE" 570
5\0
PRINT"INSURANCE ANYONE
ITYPE 1 OR 0. 1 MEANS YfS)"'
515
INPUT I
521
PRINT
525
IF 100 THEN 570
IF 1(1)<>21 THEN 55~
530
535
LET WI'''I ••
540
PRINT
545 PRINT 'VOU WIN S""," ON YOU~ INSURANCE aET"
550
GOTO 810
555
~ET 01'01-w/2
550
PRINT
555
PAINT'YOU ~OST S'W/2," ON YOUR INSURANCE BET - 1 nON' T HAVE 8~ACKJAC~"
510
IF TCI)<>21 THEN 805
575
PRINT
5e0
PRINT""! HAVE 6~ACKJACK""
585 PRINT "MY HO~E CARD .AS ".
590
IoET X.M
595
GOSU8 103~
600
GOTO 1300
605
IF T(P)"21 THEN 650
610
IF E(p»0 THEN 640
515
PRINT"VOU 8USTED, "
620
PRINT"VOUR TOTA~ IS "TCP)
625
~ET cl'T(P)-5*(INT(T(P)/S))

160

:~:

~~T~(~l;~

THEN 775

40

~ET E(P)'E(P)-I
~ET TCP).T(P)-10
IF V(I)'2 TH£~ 620
~ET V(3)'V(3).1
PFUNTlqUT
INPUT VO)
IF V(I)<>3 THEN 830
IF V(2)'0 THEN 820
IF V(3)";! T~EN 820
IF Q(G)'Q(S) THEN 700
PRINT'NOW IS THAT A PAIR"
GOTO 8ee
LET V121.1
IF QIG).'I THEN 115
~ET VIIl.2

II,

~ET P.~

PRINT"
PLAY HAND ONE NOW'
PRINT"'IRST CARD IS '.
LET .(3)'.
LET X.G
G08Ue 710
GOTO 431
GoeUe
GoaUe \835
~ET V(3).1
~ET T(PloC
RETURN
~ET P'2
LET V(2) 02
PRINT"
p~AY HAND TWO NOW"
PRINT"fIRST CARD IS'.
~ET x·s
GOSUB 750
IF QIGhl THEN el5
UT v(\).e
GO TO 430
PRINT"ND sPLITS NO. -- TRy AGAIN"
GOTO 660
IF V (1) 02 THEN e~5
IF V(3)'2 THEN 850
PRINPTOO ~ATE TO DOUbLE. CHAR~!E."
GOTO 660
LET W(P).2+WI P )
IF V (Il >0 THEN 43~
GOTO 620
Gosue 900
~ET TlP)'T(P).C
IF V(51.0 THEN 890
LET V(5)'0
RETURN
Gosue 1035
RETURN
IF RuS0 TH~N g45
~ET NI\0+0+ABS(COS(N.WI")
FOR A"I TO N
UT xoINTI52.999999+RND(Vl)
IF X'0 THEN 915
NEXT A
IF D(X)'0 THEN 980
LET HoR.1
IF R.50 THEN 900
FOR Aol TO 52
IF O(A).K TKEN 980
~ET 0IA)'0
NEXT A'
~ET R'0
PRINT'
I RESHUFFLED
"
GOTO 900
~ET R'0
!.ET O(X)'K
If Q(X)OI THEN 1~10
~ET C.II
~ET E(P).E(P).I
RETURN
IF QCX'>10 THEN 1~25
UT C.Q(X)
RETURN
LET CaU
RE TURN
GOSUB 1050
GOSUS 1120
HE TUHN
IF Q(X)<>I THEN 1065
PRINT" ACE "I
HFTURN
IF QI~'>10 T"E~ 108~
PRINT Q(XlI" "'
RETURN
IF Q(X)'II THEN 1095
PRINT" JACK "'
RETURN
IF Q.(X)'12 THEN 1110

ne

PRINT" QUEEN

II,

RETURN
PRINT" ~ING "'
HE TURN
IF· X>39 THEN 1145
IF X>26 T.EN 115b
If X>13 THEN 1165
PRINPOF SPADES"
RETURN
PRINT"OF CLUBS"
RETURN
PRINT"OF HEARTS"
RETURN
PRINT'OF DIAMONDs"
RETURN
LeT P'2
PRINT liMY I'IOLE C4. Q O \IIA.S ",

LET XoM
GOSUS 103b
If T(2).22 THEN 1210
If V(2)'0 THEN 1300
IF T (3»21 THEN 1300
LET· P'I
IF TlI).11 THE" 1360
IF TO»11 THE~ 1230
If E(I»0 T.EN 1360
IF T(I»21 THEN 1375
~~ T P.2
PRINT'~Y TOTA~ IS "HI)

BLKJAC

SAMPLE RUN
TYPE 'YES' IF YOU NEED HELP? YES

IF T(P)'21 THEN 1300
1246
IF TeI»21 THEN 1265
1250
1255
IF T(I»T(P) THEN 1300
IF TO).TlP) THEN 133A
1260
1265
L~T WI·.I."(p)
If
CI>3 THEN 1445
1270
1275
IF CI>2 THEN 1465
1280
IF CI>I THEN 1485
1285
IF CI'0 THEN 1505
GO TO 1525
1290
GOTO 1330
1295
LET wII.I-W(P)
1300
1305
IF CI'3 THEN 1545
IF
CI>2 THEN 1565
1310
IF CI>1 THEN 1585
1315
1320
IF CI'0 THEN 1605
1325
GOTO 1625
1330
IF V (2)'P, THEN 1345
1335
GOSUB 1405
1340
GOTO 265
LET po3
1345
LET V(2)10
1350
GOTO 1245
1355
1360 PRINT "I DRA.-,
1365
GOSUB 865
1370
GOTO 1210
1375
IF E(I).0 THEN 1395
1380
L:II'I T'l"N 190
NEXT I
I~m IF R<:A0 THl'N 210
2~0 nOTC I ,~I'J
21r PRINT ·THf' SP~"~ 0" TH" Gl,I~ BOAT IS NOW ·,R,· KNOTS·

TIII~ IS THF r,AM<:·O". WAR ~FT"""N A SUBMARINE AND A
N~VAL r,IlN RO~T. "'DULl) VOl! LlKF INSTRUCTIONS? YES
yOll A~F Til" CAPT~IN nF !Hr. SUBMARINE AND THe.
COMPlITFR IS TIlF CAPTAIN ~F TfI" GUN "O.~T.
THE SPF"D 0" THF mIll "OAT IItLt ~F GIVEN AT THE BEGINNING OF
Till' r,AME ~NO YOII H~V~ TO "IT. T'lF GUN BOAT .TWICE
IN AT L"A~T TWO VULNFRABLi" PLAC"S, 00. ONCE IN A
VULNERABLI' PLAC. A~D TI,IICF IN ANY OTHFR PAlIT OF THE
IIULL OF TIlF nu~ ~OAT. BUT IF YOli MISS ANY ONE TIME THE
GUN ~OAT WILL OPFN "IRF ON VOIl UNTIL IT SINKS YOU Oil YOU
SINX THF nUN BOAT! YOII WILL !'IF ALLOW"O TO TAKE TURNS FIRElNG AT TH", GUN ~O~T ....... GOOD LUCK, MnN FURHERIIIII!!!!
T'I" SPf:rD OF THE GUN BOAT IS NOW 17.~9328 KNOTS
THE RANG, FROM THF mIN qOAT TO TifF SUBI'!ARINF IS
NOW 5136.84~ YARDS.
THF APRPO)(Ii'fATF ANGL; YOII SHOULD FIRE YOUR TORPEDO IS
BETWEl::N 69 AND 7 ~ DFGIIEF'~.
? 71

*********

**+
********* ***+**
HHH
UII!)

L---------I
--lOR !IllIllIIl
100\-[::.:::::.::::::::::::::]
----lnDn~
11I"HH'l 0 a 0
0 0 IIHHH\
IPDDD\---\F;"'''FFrl'1'F''FF'F''''FFF''''F'F ••••••••••••••••••• /EEEEEEEEEEEEEEEEEI
E""FFFFr"FFFF""~F"
EFEEE
0
EEEEEEI
\FFl'FF""I'F'''FF''FF
EEEEFEEEEEEEEEEEI

22~ !lA~OOMI1.F
2,~~

FOR F: I TO ,
I..FT S:I~~~~*~NDC~)
27~ IF S>:10P~ THFN 29~
2B? NF)(T "
2~~ I" S<:IA~~P T~'N 'I~
.,0P r,o TO 2'0
~IP PRINT ·Ttl' PA"G" FPOM T~r r,IIN qOAT TO THE SUBMARINE IS·
,'~~ P~INT ·~OW ·:5,· .,-APOg.·
~,W Ln 7:~TNC5~/q)
,'4~ LFT D,,:r*Clg~I'.I'1·9)
,'4' PpINT ·nl' APPPO)(IM~T" ANoL' "-OU SHOULD "IRE YOUR TORPEDO IS·
~4~ p~INT ·RFTWCFN ·'INT(~.'-2):· AND ·,INTCD3+2),· DEGREES.·
". ~ I'I~"T D
,"l~t LI:"T T=n*,"l.141c;9/"IRPl
,60 LrT RR:~/r,0!l(7)
'7~ Ln Y:"=P8*SINC71
:"RP LET y.:~g*SINCT)
,'9~ Lq Y2:V3-2~
4~0 L"T y~:y,'-~0
AI ~ L"T Y4:Y"+2~
.2P LFT y,;:y3+A~
.,~ IF Y9p.ye THF, 71~
r-OTO 0;20
4,~' IF Y9.Y3 THFN A~~
480 GOTa I'9A
A9~ I" Y9Jl) iN

*'

612

pqI~T

,r;13 P~I NT
~2· ~:.~+I

,;,'~
~.~

$5~

"*********

vOlT Ma.f'F l\ VUL ?N?FRI\9LF STRIKE!

I

*************"

IF A>:2 MTO' 70~
nOTO 12~
PRINT

,.

*********

A,'"

*

~c;!?'

P:~etPR I NT"' 1="F'~l:'1="L"J;"rJ;"F'r!:"!:,,L"'C'rf'C'F1="p''C'Fr.: ••••••••••••••••• •• /F:E''EEEEEEEEEEEEEEr
~et~P~INT"
FF~rrFr~Frr~L"'C''C'FFF

EEEEE

9IpPpINT· \"rl'F"~FF1'''l''''F''
92P no TO 61.

0

EEEE!

EEEEEEEEFEEEEEEE/·

~,W"!'INT·\!::FF"FF"""""'FF~"l'l""\ ••••• ~ . . . . . . . . . . . . . . . . /EEEEEEFEEEEE'EEEE!

~'0PRINT·
Ff""","FF;·"1'F1'Fl'l'F"FF"FFFFFFEFEFEEFF:FFFEEEEEEEEE·
~6APR I NT·
\EFFF"l'Fl'''FFl'C~1'~;FF!''.''''FFFFFEEFEFEEEEEEf.EEEE
970 no TO I;,~
18~0 PPINT "
II·
Isrl PRINT·
IIHHI·
IR02 PRINT·
X>
T IHHHHI"
IR03 P~UT "
IS(!IA PRI ~T
190~ PRINT ·WOULD VOU Ll1(F TO TRY ~G~IN'I
19~1 INPUT ~~

*"

*******************************tI

1~~2

I~ ?~="YF~"

2~~e

END

~M

T4~~ ~

44

a EEEEEEEEEI

Er,..r.t;',..!;'~I';"!;'r~~l';"rrft;'F~~F~FFFFFFF.FF.EFEEEF.EEEEEEEEE/

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

YOO ~~1"C' 1\ V'lL '?N?t'~4F!LF ~TPI}(F.!
SIlN.! . . . . . . . . o,oary "VF CRIIFL ~IORLD .... CGLUB .. GLUB .. )
II
X>

//"'11

T/UH'I. n-f I

*******************************
1,mIlLD YOI! Llw· TO "BY ARUN? NO

651 P~INT
652 PPI NT .********* von DA~AGl'n THF Glm BOAT I *************.
660 9:B+1
67~ I; B>:~ AOTO 70~
SP'(!I n' A+9>." TlFN 7P,P
~9~ AO TO 12(!1
7A~ PRI NT "I AM SIINX' . . . . . . . . AnOD .qYF CRUEL WORLD . . . . CGLUB .. ALU9 .. )·
70" nOTa 18(!1~
71A poINT"
*********
72(!1 PllINT •
***+*+* , ..
730 PPINT •
HHf! I·
IJUU ,+++++].
740 PPINT "
7'. PRINT·
"":::V.~:~"
76P PpINT •
L---------I"
'7(!1 PPI NT "
--/n~ IIIIlllllI
100\--·
[ : : ::: :~:::::::::: :::;:~].
7RA "~lNT "
790 PRINT·
----/nnn~
IHH'l'l'l 0 0 0
0 0 HHHH\
IPDOO\-"
p(!lP <'0 TO
"I~ PPINT
FF"F"F~"'FF\ . . . . . . . . . . . . . . . . . . . /EEEEEEEEEEEEEEI!
~FcFFFF;F1'FF!'FFFFEfFFF,EEEFEEEEEEEEE
0 EEEEEEEE
"20PRI NT·
p~~P1l1 NT·
F··"F"r F."FF'F"FEFFFEFFEFEEEEEEEEEEEEEEEEEEEEEE7
PA~ no TO 51.
'" (!IF? I NT"\l'c"Fr"~c~"~F"'''FrFl'l'''F"\
. IEEEEEEEEEEEEEEEE!
,,~iop~ I NT· . "EF"""F,j,l'F
FFF;FF;F;,FEF-EEEFEEiEEEWcE Iii
EEEEEE?
P'(!IPP INT·
\ F"""1'1'
*
EF"EEEFFEFEEEEEEEEF:EEEFEEEEEEEEEEEI"
RRr r.;O TO

~r.,..r.r~~I';"!;'r.Frr~r,l';"r~F,..,..Fr.F~'!"!;'FFFEFEF.EF.

*********

"'9'; :-iOTO 1<)0'"

DRINT

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

YOU MItT)\';" ~ VPL ?N?'!"P4RL1<' STRIKE'!
Tu" !;?"F'D ~" T'l" ~"N Ra~T I~ ~OW
17.18",~6
KNOTS
TH' p'~~r" "ROM T'lF ~"N qOAT TO T'l" SUBMARINE IS
"OIl 0427 .~92 YARD!'.
THF ~ PPROXIMATr .~"o,!5 YO" SHOI.!LD "lPF. YOUR TORPEDO IS
llr;"TW""FN $~ ~.ND 7,'f, T')t;'GR1<'C"S.

'.'9.

61~

+++++1

\\\\:::IIJ:~:I'J

BOMBER

FLY A WORLD WAR II BOMBER

Description
In this program, you fly a World War II bomber for one of the
four protagonists of the war. You then pick your target or the
type of plane you are flying.
Depending upon your flying experience and the quality of the enemy defenders, you then may
accomplish your mission, get shot down, or make it back through
enemy fire.
In any case, you get a chance to fly again.
Program Author
This program was somewhat modified at DIGITAL.
author is:
David Sherman
Curtis Junior High School
Sudbury, MA 01776

C;,;;. :;a

45

The original

PROGRAM LISTING

SAMPLE RUN

5 RANDOM'PRINT"YOU ARE NO. A pr~OT IN A WORLn WAR II BO~eER
10 INPUT "WHAT SIDE -- lTA"Y(ll, ALU~S(2l. J.PANESEI3l. GERMANYC4l"IA
20 IF A.0 AND Ac5 f~EN 2~ ELSt: PRINT "TRY AGAIN .... "\GOTO 10
25 ON A GOTO J~.II~.200.220
30 INP:U'f "WHAT··IS YOUR TARGET -. ALBANIACl1. GREECEC21, NORTH AFRICAC3l",e
40 IF B.0 A~D ac4 THEN .4b ELS~ PRINT "TRY .GAIN .... "\GOTO 3~
45 PRINT\ON6 GOTO 50,8~.90
50 PRINT"SHOU"D BE t:ASY,YOU'RE fLVI,G A NAZI.MAOE P"ANE,
60 GOTO 280
80 PRINT "Bt: CAREFULII I "\GOTO 280
90 PRINT "YOU'RE GOING fOR THE on. EH?'\GOTO 280
110 ·INPUT "AIRCRAFT _. L1BERATORCl1. a-29(2). A-17C31. "ANCASTER(41"IG
120 IF G.0 AND 6<5 THEN 125 ELSE PRINT "TRY AGAIN .... "\GOTO 110
125 PRINT\ON G GOTO 130,15~,17~,19~
130 PRINT 'YOU'VE GOT 2 TO~S OF ~O~BS F!.YING FOR PLOESTP
140 GOTO 280
150 PRtNT "YIiU-'R~ .ORoePING THE A-SOMB ON HIROSHIMA,"
160 GOTO 28~
17~ PRINT "YOU'RE CHASH,G T,;E 8ISM.RK IN THE ~O"TH SEA."
180 GOTO 280
190 PRINT "YOU'RE BUSTING A GoRM6N HEAVY WATER PLANT IN THE RUHR."
195 GOTO 28~
200 PRINT "YOU'RE FLYING A KAMIKAZE (S-UICIDE BOMBE~l OVER THE dSS LEXINGTON."
205 INPUT "YOUR FIRST KAMIKAZE MISSION !Y OR N1"IF$
208 If F$o"N" THEN SO~\GOTO 358
210 PRINT\If RND •• 55 IHEN 325 ELS~ 380
220 PRINT "A ~AZI, EM1 OH 'ELL. ARE YOU GOING FOR RUSS!ACll, ENGLAND(21"
230 INPUT"OR FRANCE(31"1"\!' M>0 AND "<4 THEN 235 E"SE PRINT "WHAT?l"\GOTO 220
235 pHNT\uN M GOTO 200,260,270

YOU ARE NOW A PILOT IN A WORLD WAR II BOMBER
ImAT SIDE -- ITALY(1), ALLlES(Z), JAPANESE(3), GERMANY(4)? 2
AIRCRAFT -- L1BERATOR(1), B-29(2), 9-170), LANCASTER(4)?
IRY AGAIN.
AIRCRAFT -- L1BERATOR(1), 8-29(2), B-17(3), LANCASTER(4)?

250 PRINT "YOU'RE NE.AR1.fI.IG

HOW MANY MISSIONS HAYE YOU FLOWN? 200
MISSIONS, NOT MILES.
150 MISSIONS IS HIGH EVEN FOR OLD-TIMERS.
HOI~ MANY MISSIONS HAYE VOU FLOWN? 50

260
265
270
280
285
290
295
300

310
320
325
330
335

340
34f§

300
355
358
350
365
370

sr .. lINGRAD ••••• "\GI1TO

281i!

PRINT "NEARING LONOPN. oE CARt:Fv", THEY'VE GOT A G(JOD HR-RAID DEFENCE."
GOTO 2M
PRINT "NEARING VERSAILI- .. S. DUCK soup. THEY'RE NEARLY DEFENSELESS."
PRINT

INPuT ;'HO. M'-~y M-IS~Io·~~ HAVE yOu F~O.N" 'D
IF 0<160 THoN ~~~ ELSE °RINT "MISSIONS. NOT MIL,S .... "
PRINT "15~ ,,-ISS IONS IS "IGH 0 ,u.Ji) R<4 lHE.N 350 ELSE. PRINT "THY Ar;AIN .... "\GOTO 34~
PRINT\IF Ro2 THE." 36~
INPUT ".H.T IS T"E PERCENT HIT RATE OF THE E"EOY GUNN,-RS (10 TO 501"'5
IF 51 THEN 1.35
If 5+T>I"0+'"D THEN Jeo
PRI~T"YOU MADE IT THROUGH TRF.MEN~OUS FLAKII".GOTO 390
PHINT II,.. . . . . . . * BOO~ ...... .. *"

380
384 PRINT "'t'OU HAVE BEEN SHOT DOItlN ....... "

3B~ PRINT "DEAR"Y 8ELOVED. -E A"E GATHERED "ERE TOD.AY TO PA~ OUR LASI TR.IBUTE .. "
390 PRI,T\PRINTWRINT\INPUT "p"AY AGAIN (Y OR N)"ltJ$\·!F US."Y· THEN I.~

400 PRINT "tHICKEN I 1 III "\PRINT\PRI_T

999 END

YOU'VE GOT 2 TONS OF BOMBS FLYING FOR PLOESTI
HOW MANY MISS IONS HAYE YOU FLOWN? 10
FRESH OUT OF TRAINING,

EH?

N I SSEO TARGET BY 30 MILES!!
rlOW YOU'RE REALLY I N FOR IT"
DOES THE ENEMY.HAVE GUNS(1),

MISSILES(2),

OR BOTH(3)?

IlHAT IS THE PERCENT HIT RATE OF THE ENEM,' GUNNERS (-10 TO 50)? 15
YOU MADE IT THROUGH TREMENDOUS FLAK ,.,

PLAY AGAIN (Y OR N)? Y
IlHAT SIDE -- ITALY(1), ALLlES(2l.. ,IAPANESE(l), GERMANY(4)? 2
AIRCRAFT -- L18ERATOR(1)' B-29(2), B-170), LANCASTER(4)? !
YOU'RE CHASING THE BISMARK IN THE NORTH

MISSED TARGET BY 28 MILES!!
NOW YOU'RE REALLY IN FOR IT

SE~

NOW THENo

"

POES THE ENEMY HAYE GUNS(1),

MISSILES(2),

OR BaTHOl" 2

YOU MADE IT THROUGH TREMENDOUS FLAK!!

PLAY AGAIN (Y OR N)? '/
IlHAT SIDE -- ITALV(1), ALLlES(2), JAPANESED), GERMANY(4)? 4
OH WELL. ARE YOU GOING FOR RUSSIA(1), ENGLAND(2)
A NAZI, EH?
OR FRANCE(3)? 2
HEARING

LONDO~

BE CAREFUL,

THEY'YE GOT A GOOD AIR-RAID DEFENCE.

HOW MANY MISSIONS HAYE YOU FLOWN? 10
FRESH OUT OF TRAINING,

EH?

tHSSED TARGET BY 2 MILES!!
rlOw YOU'RE REALLY IN FOR IT

"

OOES fHE ENEMY HAYE GUNS(1),

MISSILES(2),

OR BOTHO)?

~~AT ·15 .lHE PERCENT HIT RATE OF THE .ENEMY GUNNERS (10 TO 50)? 40

*' '" *'

'" >fI .,. '" "" 800M *' *'
YOU HAYE BEEN SHOT DOWN ........ ' .
DEARLYBELOVED,WE· ARE GATHERED HERE TODAY TO PA,' OUR LAST TRIBUTE.

PLAY AGAIN .('/ OR N)·? v
IWAT SIDE -- IH'IL'Y(1); ALLlES(2) .. JAPANESEO), GERMANY(4)? 1
IlHAT IS YOUR TARGET -- ·ALBANIAq);GREECE(2), NORTH AFRICA(3)?
YOU'RE GOING FOR· THE OIU EH?
HOW MANY MISSIONS HAVE YOU FLOWN? 120
THAT'S PUSHING THE ODDS'
NISSED TARGET BY 13 MILES!!
rww· YOU'RE REALLY I N FOR IT
[>OES THE ENEMY HAYE aUNS(1),

"
MIS$ILES(2),

OR BOTHO)?

14HAT I S THE PERCENT HIT RATE OF THE ENEMY GUNNERS (10 TO S0)? >0
YOU MADE I T THROUGH TRE·MENDOUS FLAK!!

PLAY AGAIN (V OR N)? N
CH I eKEN ! ! ! ~ !

READY

46

BOUNCE

PLOT OF BOu,NCING BALL

Description
This program plots a bouncing ball. Most computer plots run
along the paper in the terminal (top to bottom): however, this
plot is drawn horizontally on the paper (left to right).
You may specify the initial velocity of the ball and the
coefficient of elasticity of the ball (a superballis about
0.85 -- other balls are much less). You also specify the
time increment to be used in "strobing" the flight of the
ball. In other words, it is as though the ball is thrown
up in a darkened room and you flash a light at.fixed time
intervals and photograph the progress of the ball.
Program Author
Val Skalabrin
Newport-Mesa Unified School District
Newport Beach, CA 92660
BOUNCE

EDUSYSTEM 30

BOUNCE

90 DIM T(29)
109 PRINT "THIS SIMULATION LETS YOU SPECIFY THE INITIAL YELOCITY"

110
120
130
131
132
lB

134
135
136
140
150
160
:l65
170
180
184
:lSS
186
187
190
2a0
210
220
221
222
225
230
240
245
250
260
270
275
276
280
290
3e0
310
320
330
340
350
355

360
380
390
<100
410

420
430
449

PRINT "OF A BALL THROWN STRAIGHT UP, AND THE COEFFICIENT OF'
PRINT "ELASTICITY OF THE BALL. PLEASE USE A DECIMAL FRACTION'
PRINT "COEFFICIENT (LESS THAN II. '
PRINT
PRINT "YOU ALSO SPECIFY THE TIME INCREMENT TO BE USED IN'
PRINT '"'STROBING' THE BALL'S" FLIGHT H THEN 225
PRINT H,
L=0
FOR I-I TO 51
FOR T=9 TO TIll STEP 52
L=L+S2
IF ABS(H-1. 5*(-32)*T-2+Y*C"( 1-1)*T>'>'>. 25 tHElt'.270
PRINT TAB(L/52), '0',
. . ' ..;
NEXT T
T=T(I+11/2
IF -16*T-2+V*C-(1-11*T 0 THEN 5220
PRINT "GUTTERIl"

2970
3060
3150
3240

3330
3420

3870
3960
4050
4140
4230
4320

4410
4500
4590
4680

4770
4860

4950
5040

"PLAVER'-'P"

BALl.."B

7470
7560
1650

7740
7830
7920
8010
8100

SUo

8190
8280
8370

8460
8550

FRAME:

BALL:

;2

I

TYPE ROLL
FRAME:

BALL:

0
ROLL YOUR 2NC' BALL
PLAYER
? ROLL
PLAYER;
(I

TYPE ROLL
FRAME:

BALL: 2

0 0 (I
(I 0 (I
(I

0
0

SPARE! ! ! !

PLAYER
? fWLL
PLAYER:

HPE .'OLL
FRAME; 2

BALL:

0 0 + 0
+ 0 0
0 0

a

ROLL YOUR 2ND BALL
PLAYER
? ROLL
PLAYER:

6930 IF go0 THEN 2520
NEXT P
r.F+ 1
TH~N

TYPE ROLL

0 0 0 0
0 0 0
+ 0

7020 ACf+P,3)og

IF F<11

BALL: 1

o+ a
o 0
o

PLAYER
? ROLL
PLAYER; 2

e840 ACF*P,3).U .. M

7~95

FRAME:

+ + + 0

ERROR! !

rHAMEI"Fn

5130
THEN 5'90
5220 H' NOT(Sal ANV D*l"'"
PRINT "STRIKF.lIIII"
Q03
5400
5490 IF NOrcS02 AND Dol0l THEN 576.
5580
PRI"T "SPAREIIII"
5670 Qo2
5760 IF NOT (602 AND Dc 10) THEN 603"
5850
PRINT "EPPORlll"
Qo!
5940
6030 I f NOTeSol AND 0<\0) THEN 62\@
6120
PRINT "RO~L YOUR 2ND BAL~"
6210 REMARK STORAGE OF THE SCORES
6J00
Pt<.INT
6390 ACF+P,BloD
6480
I f 602 THEN 7020
8570 S02
MoD
6660
8750 IF gol THEN 6210

na0

TYPE ROLL

0 0 + 0
0 + 0
0 0
0

5310

7110
7200
7290

YER~ GOOD.
1
? ROLL
PLAYER, 1
PLA~ER

PLA~ER:

3510

2790

I NT ED

WANT INSTRUCTIONS (Y OR NI? ~
THE GAME OF BowLING TAKES MIND ANt' SkILL. DURING THE GAME
THE COMPUTER WILL kEEP SCORE. YI)U MA,' COMPETE WITH
OTHER PLAYERS( UP TO FOUR 1. YOU WILL BE PLA,'ING TEN n'AME5
ON THE PIN DIAGRAM '0-' MEANS THE PIN I S DOWN ... ,+.- MEANS THE
PIN IS STANDING. AFTER THE GAME THE COMPUTER WILL SHOW ,'OUR
SCORES
FIRST OF AI.L ... HOW MAN I' ARE PLAI'ING? 2

PLAYER
? ROLL

SYSTEM

PRINT "PLAyER"Pl1 ""- TYPE ROLLI!
1 NPUT NS
K a 0\Oc0
FOR 101 TO 2~
X_INT CRNO C1l+100)
FOR Jot TO 10
IF XcI5+J THEN 3330
NoXT J
CClS+J-X)OI
NeXT I
REMARK PIN DUGRAM

2.80

AC~UA

ROLL YOUR 2ND BALL

234' ""a0\Qa0
2430
2520
2610
2700

WELCOME TO THE ALLE,'
BRING ~OUR FRIENDS
OKA~ LET'S FIRST GET

II'PE ROLL
FRRME: 2

BALL: 2

0 0 0 0
0 00
0 0
0

207~

P~INT I'FRAMESU
fOR 1*1 TO 10
PRINT 11
NEXT 1
PRINT
FOR pOI TO
FOR 1*1 TO
FOR Jol TO 10
P"INT ACJd)/
NEXT J
PRINT
NEXT I

SPARE! ! ! !

PLAYER 2
? ROLL
PLAYER:

HPE ROLL
FRAME:

BALL:

0 0 0 0
0 0 +
0 0

PRINT
NEXT P
PRINT "DQ YOU WANT ANOTHER GAME'
INPUT 4$

8640 IF .!.IIYI! THEN 26-1~
END

ROLL YOUR 2ND BALL

8730

PLAYER 2
~ ROLL
PLAYER:
I) 0 0 0
0 0 0
0 0
0

SPARE! ! ! !

49

H'PE ROLL
FRAME: 2

BRLL: 2

BOXING

OLYMPIC BOXING MATCH

Description
This program simulates a three-round Olympic boxing match.
The computer coaches' one of the boxers and determines his
punches and defenses, while you do the same for your boxer.
At the start of the match, you may specify your man's best
punch and his vulnerability.
There are approximately seven major punches per round, although
this may be varied in Statement 185. The best two out of
three rounds wins.
Program Author
Jesse Lynch
710 South Point Douglas Road
St. Paul, MN 55119

50

PROGRAM LISTING
lIeel
lIe02
aeen
elelS
leee7
10ell
lIe20
00l3e
Ilue

08US
nee0
n060
lieu
00070

eeeee

nee5
leeee
00100

REM
J.I
Lol
PRINT 'OLYMPIC 80XING -- 3 ROUNDS'
PRINT
PRINT "INPUT VOUR OPPONENT'S NAIIE'
INPUT JI
PRINT • INPUT YOUR MAN' S NAMf'
INPUT LI
PRINT
PRINT "OIfFERENT PUNCHES ARE 1 FULL SWING 2 HOOKJ UPPERCUT 4 JAB'
PRINT "WHAT IS VOUR MANS B!ST"
INPUT B
PRINT "AND WHAT IS MIS VULNERABILITV",
INPUT
PRINT
81IINT( •• RNO+I~
OI'INTC,ORND+11

Inn

11311
11330
01340
ee341
10345
01351
11360
.1375
luem
c 10390
e84em
00411
leUI
01425
.044m
104G0
11455
01460
00470
11475
88480
18490
18em8

Is "SI" AND
FOR R'I TO 3
IF J>o 2 THEN 1040
IF L>'2 THEN 1060
X'I
V.I
PRINT
PRINT 'ROUND "R" 8EGINS ... '
PRINT
FOR RI' I TO 7
I'INToe oRNO.I)
IF I>e THEN 610
PRINT LS ., S PUNCH"
INPUT P
IF P'8 THEN 22S
GO TO 230
Xlh2
IF PII THEN 340
IF P'2 THEN 450
If P'3 TMEN 520
PRINT L$ "HBS H 'JS"S HEAD "/
IF 01" THEN 290
C'INTChRNO.1 I
IF Cd TMEN 31B
X.X+3
GO TO 951
PRINT "ITS SLOCKEO'
GO TO 950
PRINT L• • SWINGSc AND "
If 01'4 THEN '10
X3 'INTC30 oRND.I)
If X3ell THEN 410
PRINT 0 HE ~IsSES "
IF X'I TMf~ 950
PRINT

DISADVANT~Gi

legU
eeg54
e8,55
11958
11961
e8,al
10.0a
el98l
11808
cC8181·0
81030
81040
IUU
11060
el17.
01188
01885
118,1
01100
81110

Is SfCRETi

oR·

W;:: ROUND
J'J+I
GO TO 950
PRINT LS ' WINS ROUND OR
LIL+I
NEXT H
IF J>. 2 THEN 1040
IF L>'2 THEN 1060
PRINT J . . IS KNOCKED CoLD .ND • LS' IS TME WINNER AND CHAMP "'
GO TO 1088
PRINT Llc" IS KNOCKED tOLD AND' JS. IS TME WINNER ANO CHAHP -,
GO TO 1000
PRINT JS' WINS CNICE GOING l ' J.
Go TO IIle
PRINT L. " AMAZINGLV wINS
GO TO 1000
PRINT
PRINT
PRINT "AND NOW GOODBYE FRO" THE OLYMPIC ARNEA."
PRINT
END

PRI~T

GO TO 300
PRINT '"E CONNECTSI'
IF X>35 THEN gee
X'X.\5
GO TO 31m
PRINT LS 'GIVES THE HOO~ "J
If DI'2 THEN 4em
HI lINT (2.RND.I)
IF HI'I THEN ee~
PRINT "CONNECTS.~."
X'X .• 1
GO TO 380
PRINT "BUT IT'S B~OCKED CIIIIIIIIII'
88eu GO TO 300
US20 PRINT LS ' cTRIES AN UPPERCUT
'"
00530 IF 01'3 THEN 510
a0e41 D5'INTCI0~oRND.ll
IUU If Dse51 THEN 570
01e50 PRINT ' AND IT'S BLOCKEO (LUC~Y BLOCK Il'
00565 100 TO 300
0061' PRINT 'AND HE CONNECTSI'
00see X'X"
00590 GO TO 300
01600 J1 'INT('.RND.1l
0ea01 If J1 .81 THEN 615
0"02 Go TO 618
08a0e Y'V.2
00610 IF J7.1 THEN 120
08620 IF J1.2 THEN e10
line IF J7 '3 THEN e68
01640 PRINT JS' JABS AND',
00645 IF 0'4 THE~ 700
0.650 Z'c'INT(7oRNO.I)
10655 IF Z4>4 THEN 898
00660 PRINT' IT'S BLoCKED I'
1167. GO TO 31S
10690 PRINT n SLOOD SPILLS III"
e0100 V'Y.S
88710 GO TO 388
88720 PRINT JS' TAKES A FULL '''ING AND',
88738 IF 0'1 THEN 118
01741 R6'INTI6e.RNO.1)
18145 IF R6 e30 THEN 770
18151 PRINT' SUT IT'S SLOCKED I'c

SAMPLE RUN
RUN BOXING
OLYMPIC BOXING -- 3 ROUNDS
INPUT YOUR OPPONENT'S NAME
? t1EATHEAD
I NPUT YOUR MAW 5 NAME
? SUPERt1AN
DIFFERENT PUNCf\ES ARE ~ FULL SWING :2 HOOK:;: UPPERCUT 4 JAB
WHAT I S YOUR MA~NS cBEST?c 2
AND WHAT IS 'HIS. WLNERABILlTV? 3
MEATHEAD' ~.·ilDcV,ANTAGEc IS

SUPERMflN'SPUNCH? c2 c
SUPER'«AN GIVE$:THt HOOKc
SUPERMflN G}V!i:S cTIjEcHOOKc
A'ND AGAIN!

.c ...•

,'.',

::~;: =~I~~

HI~

AND VULNERABILITY IS SECRET

SUPERMAN'S PUNCH? :2
ME(lTHEAD GpS SUPERMAN IN THE JAW

35c THEN lelB
V"VOIS
GO TO 308
PRINT JS' GETS 'LS' IN THE JAW
COUC""·
Y·V.7
PRINT • .... AND AGAINI'
Y'V+5
IF y>3S THEN 1010
lIe51 PRINT
0e860 PRINT ~ • • IS ATTACKED By AN UPPERCUT 10H, OHl ••••
BeB65 If 013 THEN 890
08870 ~"INTC2000RNO.ll
leen IF Q4.15 THEN 920
0een PRINT " AND "JI" CONNECTS ....
18900 Y'VOB
18'U GO TO Jee
10920 PRINT • BLOCKS AND HITS 'J" WITH A HOOK.-

4

cBI;GINS..

ROUND

c

10780
187V8
8eee0
IfaU
el820
10830
088J5
10840

::m ~~I~;Y J~H;N

o

:::~: ~~I~~·3~.T:g:.~~A'E

8813e
el140
011ee
11160
08170
01175
00\80
eel81
0018e
0el90
el200
0UIB
11220
01221
08222
01225
10230
10241
00250
00210
le211
11215
112U
012ge

IUU X'X ••
.IUe GO TO 38'
.1950 NEXT RI

1"-

MEATHEAD WINS ROUND
ROUND

2

~

BEGINS ..•

MEATHEAD
TAKES A FULL SWING AND POW'!'!! HE HITS HIM RIGHT IN THE FACE!
MEATHEAD GETS SUPERMAN IN THE JAW
(OUCH!)
. c .. AND AGAINc!
SUPERMAN IS ATTACKED BY AN UPPERCUT (OH, OH).
AND MEATHEAD CONNECTSc
MEATHEAD
TAKES A FULL SWING AND POW!!!!! HE HITS HIM RIGHT IN THE fACE!
MEATHEAD GETS SUPERMAN IN THE JAW
(OUCH!)
. ... AND AOAIN'
SUPERMAN IS KNOCKED cour AND MEATHEAD IS THE WINNER AND CHAMP

51

AND NOW GOODBYE FROM THE OL YMP I C ARNEA.

BUG

DRAW A BUG VS THE COMPUTER

Description
The object of this game is to finish your drawing of a bug
before the computer finishes his. You and the computer roll
a die alternately with each number standing for a part of
the bug. You must add the parts in the right order; in other
words, you cannot have a neck until you have a body, you
cannot have a head until you have a neck, and so on. After
each new part has been added, you have the option of seeing
pictures of the ,two bugs.
If you elect to see all the pictures, this program has the
ability of consuming well over six feet of Teletype paper
per run. We can only suggest recycling the paper by using
the other side.
'
Program Author
The author of this program is in the 7th grade at Harrison
Junior-Senior High School.
Brian Leibowitz
27 Danner Avenue
Harrison, NY 10528

52

PROGRAM LIS'rING
10
20
30
41

51
60
70
S0
90

\00
110
120
130
140
15 0
160
170
180
190

21e
210

220
230
240
258
260
270

280
290

301
310
320
330

, 340

350
360
370
380
390
41m
4U
420
43 0

440
450
460
470
480
490

slm

SI0
520
538
540

558
560
570
580

598
600
610

620
630
640

650
660
670

ee 0

690
700
710
720
730
740
750
760
770
780

790
800

SII
820
830

840
860
860
870
S80

a90
ge0

910
920

938

9 40
950
960

970
980

998
1800

1010
1020
1030
1040
1050
1060
1070
1080
1190
1110

1110
1120
1130
1140

1160
1160
1170

1180
119B
1280

1210
1220

REM SRIAN MONTE ~EIBOWITZ GRADE 7
REM HARRISON JR, SR, HIGH SCHOO~
REM HARRISON N,V,
DIM ZS 131
A
H-l aN. p.QaR.S.T .U.V.Y afl
PRINT "THE GAME SUG IS ~IKE THE GAME COOTI,'
PRINT "I HOPE yOU ENJOv THIS GAME"
PRINT
PRINT "DO YOU WANT INSTRUCTIONS"'
INPUT ZS
IF lS"NO" THEN 3U
PRINT "THE OSJECT OF SUG IS TO FINISH YOUR BUG 8EFORE I FINISH MINE'
PRINT 'EACH NUMSER STANOS FOR A PART OF THE BUGS 800V"
PRINT ' I WI~L ROLL THE DIE FOR YOU, TELL YOU WHAT I ROLLED FOR YOU"
PRINT "WHAT THE NUMSER STANDS FOR, AND IF YOU ON GET THE PART ,"
PRINT "IF YOU CAN GET THE PART I WI~~ GIVE IT TO VOU,"
PRINT 'THE SAME WILL HAPPEN ON MV TURN'
PRINT 'IF THERE IS A CHANGE IN EITHER SUG I WI~~ GIVE YOU THE'
PRINT .OPTION OF SEEING THE PICTURES OF THE BUGS,"
PRINT "THE NUMBERS STANO FOR PARTS AS FO~~OwSI"
PRINT "NUMBER"' 'PART", "NUMBER OF PART NEE OED"

-a.

PRINT
PRINT
PRINT
PRINT
PRINT
PRINT

"1",IIBODy",1I1"
"2","NECK·","1"
"3","t-tEAD","1"
"4", "FEELERS", "2"
"5 11 ,"TAIL","1"
"6","lEG!!P',"6"

1~20

1430
1~40

1450
14U
1470

1480
1.90
1500
1510

PRINT
PRINT
IF V>0 THEN 2480
~El Z'INTlt-RND(0)+\)
C'1
PRINT ·VOU ROLLED A "Z
GOTO Z OF 3S0, 430,540,650.760,870
PRINT "1.eODV·
IF B.l THEN 410
PRINT "YOU NOW HAVE A BODV"
S'I
C·e
GOTO 970
PRINT ·VOU DO NOT NEED A eODY"
GOTO 970

'1520
1530
lU0
1550
1560
1570
15S0
1590
1600
1610
1620
1638
1640
16 50
1660
1670
1680
1690
1700
1710
1720

PRINT t'2I1NECKIl

IF N'1 THEN 500
IF 8'e THEN 52~
PRINT 'YOU NOW HAvE A NECK"
N·l
C.0
GOTO 97~
PRINT "YOU DO 'OT NEED
NECK"
(fOTO 970
PRINT ·yOU DO NOT HAyE • BODV"
GO TO 970
PRINT '3.HEAD'
IF N'0 THEN 610
IF H'1 THEN' 630
PRINT "VOU NEEDED
HEAD"
H_l
C.0
GOTO 970
PRINT "VOU DO NOT HAVE A NECK'
GOTO 970
PRINT 'VOU HAVE A H~AO'
GO TO 970
PRINT '4.FEElfRS"
IF H'0 THEN 740
IF .,2 THEN 720
PRINT "I NOW GIVE YOU A FEE~ER"
LET A.A+l

ln0
17 40
1750
176,
1770

1780
1790
1800
1810
1820
1830
1840
IS50
IS60
1870
1880
1890
1900
1910
19 20
1930

C.,

GOTD 970
~RINT "YOU HAVE TWO FEELERS AlREAnV"
GOTO 970
PRINT "YOU DO NOT HAYE A HEAD"
GOTO 970
PRINT "S-TAIL"
IF S00 THEN 830
IF T'1 THEN 850
PRINT "I NOW GIVE YOU A TAIL"
~ET ToT+l
coe
GOTO 970
PRINT 'YOU DO NOT HAVE A BODV"
GOTO 970
PRINT "YOU ALREADV HAVE A TAIL'
GOTO 970
PRINT "6'LEG'
IF l'6 THEN 940
IF B'0THE" 960
lET L'L+I
c·e
PRINT "YOU NOO HAVE 'L' lEGeS)'
GOTO 970
PRINT "YOU HAVE 6 FEET AlREAcY"
GOTO 970
PRINT ·YOU DO NOT HAVE A BODY·
LET XoINT(6.RND(0)+!)
PRINT "I ROllED A 'x
GO TO x OF 10e0,U8001190,13~0.14U,1520
pRINT "1'BODVIF P'1 THEN 1060
PRINT • I NOW HAYE A SDDY"
C'0
P.l
GDTO 1630
PRINT "1 DO NOT NEED A BODV'
GO TO 1630
PRINT '2.NECK·
IF Q'I THEN 1150
IF p.e THEN 11,70
PRINT • I NOW HAVE A NECK"
Q'1

19~0

1950
1960
1970
1980
1990
2000
2010
2020
2030
2040
2050
2060
2070
2880

2090

aIB0
2110
2120
2130

2140
21ee
2160
2110
2180
2190
2200
2210
2220
2230
2240
2250
2260
2270
22 8m

2290
2310
2311
2320
2330
2340
2350
2360
2370
2380
2390
24 00

Cd
GOTO 1630
PRINT • I DO NOT NEED A NEl:K"
GOTO 1630
PRINT "I DO NOT HAVE A BODV'
GOTD 1630
PRINT "3'HEAD'
IF Q" THEN 1260
IF R'1 THEN 1280
PRINT ' I NEEDED A HEAD'

1230
1240
1250
1260
1270
128m
1200
1308
1:i!0
1320
1330
1340
1350
1360
1370
1380
1390
1400
1410

2410

53

2420
2430
2450

R'1
C'0
GOTO 1630
PRINT "I DO NOT HAVE
NECK"
GOTO .1638
PRINT "I 00 NOT NEED
HEAD'
GOTO 1630
PRINT '4'FEElERS"
IF R.e THEN 1390
IF 5'2 THEN 1370
PRINT "I GET A FEE~ER·
~ET 8'5+1
C'0
GOTO 1630
PRINT "I HAVE 2 FEELERS ALREADY'
GOTO 1630
PRINT "I DO NOT HAVE A HEAD"
GOTO 1630
PRINT "S'TAIl'
IF P'0 THEN 1481
IF U'I THEN 1500
PRINT "I ~OW HAyE A TAIL"
U'1

e.0

GO TO 1630
PRINT "I DO NOT HAV~
SODY"
GOTO 1630
PRINT "I DO NOT NEED
TAIL"
GOTO 1630
PRINT "6 a LEGS"
IF V'6 THEN 1590
IF P'0 THEN 1610
UT vaV+l
C.0
PRINT "I NOW HAVE ·V" LEGeS)"
GOTO 1630
PRINT "1 HAVE 6 HET"
GO TO 1630
PRINT "1 00 NOT HAVE' A BoDY·
GOTO 1630
IF A'2 AND T'I ANO L.e THEN 1650
GOTO 1670
PRINT "YOUR BUG IS FINISHED'
lET Y.Y+I
IF 5'2 AND P'1 urD Va6 THEN 1690
GOTO 1710
PRINT "My BUG Is FINISHED"
lET Y'Y+2
IF C'1 THEN 300
PRINT "DO YOU WANT THE PICTURES"
INPUT ZS
IF ZSo"NO" THEN 300
PRI~T

"••••• YOU-R BUG ...... ..

PRINT
P~INT

IF A'0 THEN Ieee
FOR Z'1 TO 4
FOR X'1 TO A
PRINT TA8(\0l'
PRINT "A .,
NEXT X
PRI~T

N~XT Z
IF H00 THEN 1880
GOSUB 2470
IF N'0 THEN 1920
FOR Z<1 TO 2
PRINT •
" N"
NEXT Z
IF B'0 THEN 200~
PRI~T •
SBBA8BBBBBSB"
FOR Z'I TO 2
PRINT"
B
8"
NEXT Z
IF Til THEN 1990
PRINT 'TTTTTB
S'
PRINT "
BB6B88BS8SBB'
IF l'0 THEN 2080
FOR l'l TO 2
PRINT TA8(5)J
FOR X'1 To l
PRINT " L ".1
NBT X
PRINT
NEXT Z
FOR Zal TO 4
PRINT
NEXT Z

PRINT "•••••• MV BUG ••••••• "

PRINT
PRINT
PRINT
IF 8"0 THEN 2230
FOR Z'I To 4
PRINT HB(1S!I
FOR xal TO S

PRINT "F

'I,

NEXT X
PRINT
NEXT Z
IF RU THEN 2250
GOSUS 2470
IF Q'0 THEN ,2288
PRINT"
N N"

PRINT "

~

Nil

IF P.0 T'=C(Rl-WTHENIF4-P)=B(A)-YGOTQ448
439 LETG(P ).G(P)+3 : 'I FG (P »9THENLETG (P) =O( P) -10
432 IFP=9THENIFG(P)=D(1,0)GOT0150
435 IFG(P)(>D(J,P)GOT0410
440 LETP=P-1:IFP<0THENGOT0150
445 00T0430
448 NEXTA
450 LETP~P+1:IFP<5GOT0405

455 LETJ=J+1
460 FORI=0T04:LETD(J,I)=G(I):NEXTI
465 RETURN'
.
500 PRINT:PRINT'PRINT'
BRADFORD UNIYEr;:SITY BULLS AND cows GAME
510 GOT010
999 END

SAMPLE RUN
BRADFORD UN I YERS ITY BULLS AND COWS GAME

YOUR GUESS? 12345
o BULLS 2 COWS - /'IY GUESS IS, Gen1 i'lY SCORE? 1,2
YOUR GUESS? H5~7
,
1 BULL 2 cows - MY GUESS IS 6195, MY SCORE? 0"
YOUR GUE~S? 67$90
o aULLS 3 COWS - MY GUESS IS 94231 MY SCORE? O,4
YOUR GUESS? 67913
o BULLS 3 COWS - MY GUESS IS ~7319 MY SCORE? 1,2
YOUR GUESS? 24678
3 BULLS 0 cows - MY GVESS IS 16429 MY SCORE? l,~
YOUR GUESS? 25679
1 BULL 1 COW - MY GUESS IS 19384 MY SCORE? 2,1
YOUR GUESS? 64378
2 BULLS 2 COWS - MY GUESS IS 15342 MY SCORE? 2,3
YOUR aUESS? ~4638
5 BULLS - YOU MIN

Our mystery number was .12345
Computer I s sco;re is 1 BULL for the 3
and 2 COWS for the 1 and 2.

Our mystery number was 13579
YOUR GUESS? 12345
1 BULL 1 COW - i'lY GU~SS IS 46098 MY SCORE? O,1
YOUR GUESS? ~3579
o BULLS 2 COWS .- MY GUESS IS 79321 MY SCORE? 0,4
YOUR QUESS? 24680
o BULLS 3 COWS'- MV GUESS IS 021n MY SCORE? 0,3
YOUR GUESS? 35680
e BULLS 3 CO~S - MY GUESS IS 35719 MY SCORI;:? 0,5 'l'his. clue was incoJ:rect becaul\le the 9 .is in
the right place. Score should have been 1,4.
'YOUR GUESS? 80345
o BULLS 2 COWS - MY .GUESS IS ~1S37 MY SCORE? ~,~
VO.UR aUESS? nS68
o BULLS 4 COWS
YOU HAVE GIVEN ME IMPO$SIB~E SCORES - GAME SPOILED

56

BULEYE

THROW DARTS

Description
In this game, up to 20 players throw darts at a target with
10-, 20-, 30-, and 40-point zones. The objective is to get
200 points.
You have a choice of three methods of throwing:
Throw

Probable Score

Description
Fast overarm
Controlled overarm
Underarm

1
2
3

Bullseye or complete miss
10, 20, or 30 points
Anything

You will find after playing a while that different players
will swear by different strategies. However, consider the
expected score per throw by always using Throw 3 (program
line 220):
Score (S)
40
30
20
10

o

Probability (P)
1.00-.95 =
.95-.75 =
.75-.45 =
.45-.05 =
.05-.00 =

.05
.20
.30
.40
.05

Expected score per throw

S x P

2
6
6
4
0

=

18

Calculate the expected scores for the other throws and you
may be surprised!
Program Author
Digital Equipment Corp.
Maynard, MA 01754

57

PROGRAM LISTIN(,
10 REi'I*** b.JLLSH. BY DAVE AHL
20 PRINT 'GAilE OF BULLSEYE"\PkINT\RANDtIMIZE
, ..
30 PRINT" IN THIS .GAME, UP TO 20 PLAYERS. THROWtlPiRTS AT':f'i TfIRil~T'i'
40 PRINT' win 10, 20, 30, AND 40 POINT tONES.
THE OBJECTIVE IS'"
50 PRINT "TO ~ T 200 POINTS, "\PRINT
60 PRINT "THROW', "DESCI"PTION"" "PROBABLE SCORE"

70 PRINT
1"~·FAST O\._~AFi!M"J~ "BULLSEYE OR COMPLETE MISS"
Sill PRINT
2", "CONTROLLED OVERARM", "10, 20, OR 30 POINTS"
90 PRINT
3", "UNDERARM"" "ANYTHING"\PRINT
100 DIM A$(20),S(20),W(10)\R,M=0\S(I)=0 FOR 1=1 TO 20
110 INPUT "HOW MANY PLAYERS"; N\PRINT
120 FOR 1=1 TO N'
He N:INT "NfiME OF. PLAYER" I; \INPUT A$( l)
140 NEXT I
150 R=R+l\PRINT\PRINT "ROUND"R
160 FOR 1=1 TO N
170 F'~:INT\PRINT A$(l)'''S THROW"; \INPUT T
180 IF H0 OR Tn THEN PRINT" INPUT 1, 2, OR 3"\GOTO 170
190 ON T GOTO 200,210,220
200 Pl=, 65\P2=, 55\P3=, 5\P4=, 5\GOTO 230
210 Pl~ 99\P2=, 77\P]=, 4J\P4~01\GOTO 230
220 Pl=, 9S\P2=, 75\P3~ 45\P4=.05

~!: ~;R~~=Pl

THEN PRINT "BULLSEYE!!
40 PO'INTS!,"\B=40\GOTO 290
259 IF U)=P2 THEN PRINT "30-POINT ZONE! "\B=J0\GOTO 290

2613 IF U):;;;P3 THEN PRINT "20-POINT ZONE"\B=2(1\GOrO 29.£1
2'70 IF U)=P4 THEN PRINT "WHEW!
10 POINTS, "\B=1.0\GOTO 29.0.
280 PRINT "MISSED THE TARGET.
TOO BAD! "\8=0
290 S( [)=S( l)+B\PRINT "TOTAL SCORE ="5( l)\NEXT I
300 FOR 1=1 TO N
310 IF 5(1»)=200 THEN M=M+l\W(M)=I
3:20 NEXT I
He IF M=0 THEN 150
340 PRINT\PRINT "WE HAVE A WINNER! ! "\PRINT
J50' PRINT AtOHM» II SCORED"S(W(M» "POINTS. " FOR 1=1 TO M
360 PRINT\PRINT "THANKS FOR THE GAME! "\EflO
READI'

SAMPLE RUN
GAME OF WLLSEYE
IN THIS GAME, UP TO 20 PLAI'ERS THROW DARTS AT A TARGET
THE OBJECTIVE IS
WITH i0, 20, 30, AND 40 POINT ZONES,
TO '3ET 200 PO I NTS,
THROW

DESCRIPTION
FAST OVERARM
CONTROLLED OVERARM
UNDERARM

1
;2

3

PROBABLE SCORE
BULLSEYE OR COMPLETE MISS

1(1, 20, OR 39 POINTS
ANYTHING
ROUND 6

HOW MAN I' PLAYERS? 2
NAME OF PLAYER 1 ? DAVE
NAME OF PLAYER 2 ? MARY

DfI\'£' S THROW? 1
BULLSEYE!!
40 POINTS!
TOTAL SCORE = 100
MfIR\,"'::: THROW?

DF,\o'E" $ THROW?
BIJLlSE't'E!!
40 POINTS!

20-POINT ZONE
TOTAL SCORE
100

TOTAL SCORE ='40

ROUND 7

MAR.,.'''' S THROW?

Df,'Io'E" S THROW? 2

20-POINT ZONE

TOTAL SCORE
ROUND

WHEIoI!
10 PO I NTS,
TOTAL SCORE = 110'

20

2

DfIVE'S THROIol? i
MISSED THE TARGET.
TOTAL SCORE = 40

MFIRI" S THROW? ;2
WHEW!
10 POINTS,
TOTAL SCORE = 110
TOO BAD'
ROUND 8

MFIR't'''' S THROW? 1

BULl.SEYE!!

4121 POINTS !',

TOTAL SCORE = 60
ROUND 3

MF,RI" S THROW,' 2
30-'F'O I NT ZONE!
TOTAL SCORE = 140

DAI'E' S THRO»? l '

~,;~~~D S6~~E T~~~T,
MARY'S .. THRQW? i
MISSECiTHE'T13RGET,
TOTAL, SCORE ".60

TOO BAD!

TOO 8AD!

ROUND 4

ROUND 9
DFlr,'E"::: THROW? 1
BULLSE'r'E!!
4121 POINTS!
TOTAL SCORE = 170
MARl" S l'HROW? 1
MISSED THE TARGET,
TOTAL SCORE = 140

DAYE'S. THROW? '3
IoIHEW! ,10' POINTS,
TOTAL SCORE = 50

TOO BAD'

ROUND 10

MARI:~ $

'nIROW? 3 '
20-'F'OI NT· ZONE
TOTAL .sCORE
eo,

DAVE'S THROW? 1
BULLSE'r'E!!
40' POINTS!
TOTAL SCORE = 210 "

ROUND 5'

MFIRY'" S THROW? 1

MISSED THE TARGET,
TOTAL SCORE = 140

DAVE'STHRDW? 3'
IoIHE"'! ',10 POINTS.
TOTAL SCORE = 6'0

MA~'Y' S THROW? ,j. ,
MISSED tH£"TARGET,
TOTAL SCORE = ,80

I)AVE'S THROW? 2
20-POINT ZONE
T,:.TAL SCORE = 130

TOO BAD'!

WE HAVE A WINNER!!
TOO BAD!

l)iWE SCORED 210 PO I NTS,
THANKS FOR THE GAME!

BULL

BULLFIGHT

Description
In this simulated bullfight, you are the matador--i.e., the
one with the principal role and the one who must kill the
bull or be killed (or run from the ring).
On each pass of the bull, you may try:
0 Veronica (dangerous inside move of the cape)
Less dangerous outside move of the cape
I
2 Ordinary swirl of the cape
Or you may try to kill the bull:
4 Over the horns
5 In the chest
The crowd will determine what award you deserve, posthumously
if necessary. The braver you are, the better the award you
receive.
It's nice to stay alive too. The better the job
the picadores and toreadores do, the better your chances.
This program was converted to standard BASIC (DIGITAL
Timeshared-8) by students at Lexington High School under
the direction of Walt Koetke.
Source
David Sweet
Dartmouth College
Hanover, NH 03755

59

PROGRAM LISTING
10
200
202
205
206
207
210
220
230
240
250
260
270
280
290
300
310
32121
330
340
350
360

DIM D(20)
RANDOMIZE
LET L=I
PRINT"DO YOU WANT INSTRUCTIONS",
INPUT Z$
IF'Z$="NO" THEN 400
PRINT"HELLO, ALL YOU BLOODLOVERS AND AFICIONADOS"
PRINT"HERE IS YOUR BIG CHANCE TO KILL A BULL"
PRI NT
PRINT"ON EACH PASS OF THE BULL, YOU MAY TRY"
PRINT"0 - VERONICA (DANGEROUS INSIDE MOVE OF THE CAPE)"
PRINT"I - LESS DANGEROUS OUTSIDE MOVE OF THE CAPE"
PRINT"2 - ORDINARY SWIRL OF THE CAPE"
PRINT
PRINT"INSTEAD OF THE ABOVE, YOU MAY TRY TO KILL THE BULL"
PRINT"ON ANY TURN: 4 (OVER THE HORNS), 5 "
PRINT"BUT IF I WERE YOU,"
PRINT"I WOULDN'T TRY IT BEFORE THE SEVENTH PASS"
PRI NT
PRINT"THE CROWD WILL DETERMINE WHAT AWARD YOU DESERVE"
PRI NT"POSTHUMOUSL Y I F NECESSARY"
PRINT"THE BRAVER YOU ARE, THE BETTER THE AWARD YOU RECIEVE"

~~: ::::~:i"THE

BEHER A JOB THE PICADORES' AND TOREADORES DO,"
390 PRINT"tHE BEHER YOUR CHANCES ARE"
400 PRINT
410 PRINT
420 LET D(5)=1
430 LET D(4)=1
450 DIM L$(5)
455 LET A=INT(RND(~)*5)+1
460 FOR 1=1 TO 5
463 READ L$(I>
467 NEXT I
470 DATA "SUPERS", "GOO~'', "FAIR", "POOR", "AWFUL"
490 PRINT"YOU'HAVE DRAWN A "L$(A)" 8ULL"
500 IF A>4 THEN 530
510 IF A02 THEN 550
520 GOTO 570
530 PRINT"YOU'RE LUCKY"
540 GOT0570
,
550 PRI NT" GOOD LUCK. YOU'LL NEED IT"
560 PRI NT
570 PRINT.
590 LET A$="PICADO"
595 LET B$="RES"
600 GOSUB 1610
610 LET D(Il=C
630 LET A$="TOREAD"
635 LET BS="ORES"
640 GOSUB 1610
650 LET D (2) =C
660 LET E=E
670 PRINT
680 IF Z=I THEN 131121
690 LET D(3)=D(3)+1
700 PRINT"PASS NUMBER "D(3)
710 IF D(3)03 THEN 760
720 PRINT"HERE COMES THE BULL I TRY FOR A KILL";
730 GOSUB 1930
735 ON ZI GOTO 1130,740
740 PRINT "CAPE MOVE";
750 GOTO 800
760 PRINT"THE BULL IS CHARGING AT YOUI YOU ARE THE MATADOR--"
770 PRINT"DO YOU WANT TO KILL THE BULL";
780 GOSUB 1930
785 ON ZI GOTO 1130,790
790 PRINT"WHAT MOVE DO YOU MAKE WITH THE CAPE",
800 INPUT E
810 IF Eo>INT(ABS(E»THEN 830
820 IF E03 THEN 850
830 PRINT"DON'T PANIC, YOU IDIOT! PUT DOWN A CORRECT NUMBER"
840 GOTO 800
850 LET D=D
860 IF E=0 THEN 920
870 IF E=I THEN 900
880 LET M=0.5
890 GOTO 930
900 LET M=2
910 GOTO 930
920 LET M=3
930 LET L=L+M
940 LET F=(6-A+M/10)*RND(0)/«D(I)+D(2)+D(3)/10)*5)
950 IF F00.51 THEN 660
960 PRINT"THE BULL HAS GORED YOU"
970 ON FNA(0) GOTO 980,1010
980 PRINT"YOU ARE DEAD"
990 LET D(4)=1.5
1000 GOTO 1310
1010 PRINT"YOU ARE STILL ALIVE"
1020 PRINT"DO YOU RUN FROM THE RING";
1030 GOSUB 1930
112135 ON ZI GOTO 1040,1~70
1040 PRINT"COWARD"
1050 LET D(4)=0
112160 GOTO 1310
1070 PRINT"YOU ARE BRAVE. STUPID, BUT BRAVE"
1080 ON FNA(0), THEN 1090,I1U
1090 LET D(4)=2
1100 GOTO 660
11 U PRINT"YOU ARE GORED AGAIN"
112121 GOTO 970
113121 LET c=e

II;:
~IN~:~T
1160 INPUT H
1170
1160
1210
1220
1230
1240

1250 IF K>0.2 THEN 960
1260 PRINT"YOU KILLED THE BULL"
1270 LET D (5)=2
1280 GO TO 1320
1290 IF K>0.8 THEN 960
1300 GOTO 1260
1310 PRINT
1320 PRINT
1330 PRINT
1340 IF D(4)0>0 THEN 1390
1350 PRINT"THE CROWD BOOS F"OR TEN MINUTES. IF YOU EVER DARE TO SHOW"
1360 PRINT"YOUR FACE IN A RING AGAIN. THEY SWEAR THEY WILL KILL YOU"-"
1370 PRINT"UNLESS THE BULL DOES FIRST"
1380 GOTO 1580
1390 DEF FNC(Q) = (4 .5+L/6- (D (I )+D (2) )*2 .5+4*D (4 )+2*D (5)- (D (3) t2) 1120-A)*1
1400 IF D(4)<>2 THEN 1430
1410 PRINT"THE CROW CHEERS WILDLY"
1420 GOTO 1450
1430 IF D(S)0>2 THEN 145121
1440 PRI NT"THE CROWD CHEERS"
1450 PRI NT"THE CROWD AWARDS YOU ";
1460 IF FNC(Q)c2.4 THEN 1570 '
1470 IF FNC(Q)04.9 THEN 155.0
1480 IF FNC(Q)07.4 THEN 1520
1500 PRINT"OLEI YOU ARE 'MUY HOMBRE'I OLEI OLEI"
15 10 GOTO 1580
1520 PRINT"BOTH EARS 01' THE BULL"
1530 PRINT"OLEI"
1540 GOTO 1580
1550 PRI NT"ONE EAR OF THE BULL"
1560 GOTO 1580
1570 PRINT"NOTHING"
1580 PRINT
1590 PRINT"ADIOS"
1600 GOTO 2030
1610 LET B=3/A*RND(I2I)
1620 IF B0 0.37 THEN 1740
1630 IF B00.5 THEN 1720
1640 IF B00.63 THEN 1700
1650 IF a0 0.87 THEN 1680
1660 LET C=0.1
1670 GOTO 1750
1680 LET C=0.2
1690 GOTO 1750
1700 LET C=0.3
1710 GOTO 1750
1720 LET C=0.4
1730 GOTO 1750
1740 LET C=0.5
1750 LET T=INT«0*C+0.2)
1760 PRINT"THE "A$;B$" DID A "L$(T)" JOB"
1770 IF 4>T THEN 1900
1780 IF 5=T THEN 1870
1790 ON FNACK) GOTO 1800,1900
181210 IF A$="TOREAD" THEN 1820
181121 PRINT"ONE OF THE HORSES OF THE "A$,BS" WAS GORED"
1820 ON FNA(K).GOTO 1830,1850
1830 PRINT"ONE OF" THE "AS;B$" WAS KILLED"
1840 GOTO 1900
1850 PRINT"NO "A$;3$" WERE KILLED"
1860 GOTO 1900
1870 IF A$="TOREAD" THEN 1890
1880 PRINT FNA(K)" OF THE HORSES OF THE "AS;B$" GORED"
1890 PRINT FNA+1
1930 INPUT A$
195121 IF" A$="YES" THEN 1990
1960 IF·AS="NO" THEN 2010
1970 PRINT"INCORRECT ANSWER, PLEASE PRINT 'YES' OR 'NO'",
1980 GOTO 193121
1990 LET ZI=1
212100 GOTO 2020
20ULETZI=2
2020 RETURN
203121 END
READY

IS THE MOMENT OF TRUTH. HOW DO YOU TRY TO KILL THE BULL",

IF" H=4 THEN 1230
IF H=5 THEN 1230
PRINT"YOU PANICKED. THE BULL GORED YOU."
GOTO 970
LET K=(6-A)*10*RND(0)/«D(J)+D(2»*S*D(3»
IF" J=4 THEN 129121

60

SAMPLE RUN
DO YOU WANT INSTRUCTIONS? YES
HELLO, ALL YOU BLOODLOVERS AND AFICIONADOS
HERE IS YOUR BIG CHANCE TO KILL A BULL
ON EACH PASS OF THE BULL, YOU MAY TRY
VERONICA MeN) THEN 580
IF 02>0 THEN PRINT D2;
PRINT TAB(4+8*G).;
NEXT G

2

IF D2=M(N) THEN 59121
NEXT 101

3
10

"

5

6

11

12

13

14

15

16

17

18

19

20

21

22

23

24

2s

26

27

00

29

30

31

D=D-G
NEXT N

.,* 9'" .**.*.* ••• *******. APRIL **.**.** •• ***.***. 275 **

FOR 1=1 TO 6\ PRINT CHR$C10);\ NEXT I
DATA 121 .. 31 .. 28 .. 31 .. 3121 .. 31 .. 30" 31 .. 31 .. 3121" 3b,3121" 31
(0"31,,29,,
••• " ON LEAP YEARS]
END

**********'** *** *•• *.*** ****** *****. ** ********* "'. ** .. *** ** **.

5

T

2

REM: IF YOU HAVE NO CHR$()" SUBSTITUTE "PRINT" FOR "PRINT CHR$(10);"
REM: AND "PRINT \ PRINT" FOR "PRINT CHR$e 10)"(WlTHOUT SEMICOLON).

4

9

10

11

12

13

14

IS

16

17

18

19

211

21

22

23

24

25

26

27

2B

29

30

8

••

T

128 **** •• *******.* •• *
S

M

T

MAY
101

• **.************ ••
T

245

••

F

** •• *•• *. *. *** **.* .. ** ... ** **** •• **. *** .** ***. **** ** ** ** .** *.
2

a
STO!'

66

9

3

4

5

CAN-AM

CANADIAN-AMERICAN AUTO RACE

Description
CAN-AM is a simulation of a Canadian-American Challenge Cup auto
race. The road course is fast (speeds up to 200 m.p.h.) •. It is
long (5.3 miles) and complex (8 curves and 8 straights). You are
racing the latest Group 7 cars (McLarens, Lolas, etc.).
The instructions provided by the program are self-explanatory.
You should really take heed of track hazards--i.e., rain and oil,
except, of course, slowing down too much puts you out of contention. BEWARE: This game is very challenging and addictive!
Computer Limitations
The program was written for the Honeywell/GE 635 at Dartmouth.
The main inconsistency with other computers is that several
people may race using multiple terminals; this is generally
not possible on smaller machines.
The comments on the listing are extremely comprehensive and
entertaining. We apologize for not having a sample run, but
it got wiped out.
Program Author
Mark Manasse
Hanover, NH 03755

......... ..

-

--

-"., .

67

.....

I

I,

PROGRAM LISTING
100
110
120
130
140
150
160
170
160
190
200
210
220
230
240
250
260
270
2'80
250
3"0
310
320
330
340
350
350
370
330
3 ~O
4)0
410

420
430
440
450
450
470
430
490
500
510
520
530

'
'
"
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'

n~-A~*** (BASIC PROGRAM BEGINS AT LINE 610) WAS PROGRAMMED BY MARK
~A~ASSE, TO REPLACE THE AILING VERSION HE iiROTE AS A SInH GRADER
AT HA~OVER ELEMENTARY SCHOOL.
LAST CHANGE 12/27112 BY tIANE MATHER, KIEWIT
OESCR[.PTIO~--THE PROGRAM ALLOilS YOU TO RRCE AROUND A HIGHLY
PERILOUS COURSE, RISKING BOTH LIFE AND MACHINE, IN AN
EFFnT TO RACE FRIENDS OR T~E CO~PUTER'S VERY O.N nOilporE SAM, wILDMAN WILLY, AND HOTSHOT nARRY

INSTRUCTIONS-YOU ARE ABOUT TO RACE. RACE ON ONE OF THE FASTEST COURSES
IN THE .ORLD. A ROAD COURSE. A LONG ONE. 5.3 MILES. SPEEDS
UP TO 200 r,PH. YOU CAN RACE FRIENDS(?) OR THE COMPUTER.
TO RACE THE COMPUTE R, TYPE THE SEQUENCE:
10LD CAN-AM*"/RUN
TO

~ACE

FRIENDS, TUE:

10LD CAN-AM***/LINK .N
'
'
' REPLACE <,KEYWORD> .IH ANY .ORD OF LENGTH 1 THROUG~ 8 INCLUSIVE
' THAT YOU CHOOSE. REPLACE N wItH THE NUMBER OF PLAYERS COUNTING
'YOURSELF. HAVE YOUR FRIENDS TYPE:
'
JOI N 
'
I

'

 SHOULD BE THE KEYWORD YOU USED IN THE 'LINK' COMMAND

I

' WHEN THE COMPUTER TYPES A QnSTION OF THE FORM
'
STRAIGHT A?
OR
CURVE 1:
' RESPO~D BY TYPING THE SPEED (IN ~PH) YOU DESIRE TO TRAVEL AT,
' ANL HIT THE RETURN KEY. GOOD LUCK. YOU M~Y NEED ,IT.
'
' IF YOG ARE USING A TER~INAL WITH BOTH UPPER AND LOWERCASE, TYPE
' .. ORD ANSWERS (SUCH AS YES OR ~O) n CAPIIU LETTERS.

' TO STOP THIS LISIING, PRESS THE'S' OR 'ATTN' KEY.
'
FOF MORE INFORMATICN ON MULTIPLE-TERMINAL FROGRAMMING. (A~
' ;;HE~ SEVERU PEOPLE RACE EACH OTHER). SEE TII009 WHICH IS
' AVAILABLE FROM THE KIEiiIT DOCUHNT CENTER (SECRETARIAL AREA),
' KIErin COMPUTATIOK CENTER. HANOVER, N. H. 03755, PHONE
SiD' (603) 646-2643.
550 '
550 ' EXPUNATION OF CHUGES-570'
12/27/72--TO RE~ORD INSTRUCTIONS.
5,0 '
590 ''* *
* * *
* * *
* *
6JJ
610 >EM
PLEASE REFER ALL BUGS OR CO~ME~TS TO DIANE
620 !"J9" THEN 890
'IF BET.EEN 01 AND 09, THEN MULTI-TERMINAL
860 IF A$<"Ol" rHF.N 890
870 LET 09·,'A!.( AS)
890 GOTC 960
89:) LET 0$="11
'SET THINGS UP FOR SI~GLE TERMINAL
900 GOSUB 2190
910 IF AS."NO" THEN 1'070
920 FRIH "RATE ~OURSELF AS ~ DRIVER. (1-BEST,3-"0RST)";
930 I~PUT 0
9B Ln Q(3)=Q(3)*0
950 GOTe 1050
950 L,r 0(2) = ASC(A)
'CREATE 0$ ARRAY FOR MULTI-TERMINAL
970 CHANGE 0 TO 0$(10)
'STANDA1U MOTIF
930 PH I = 0 TO 09
950
LET 0(2),. ASC(C)+I
ll00
'CHAIGE 0 TO OS(I)

*

*

* *

* *

in~ ~~g/0$(10H·YOU ~AY

(AUTO-PILOTS)

'DRAFT' (SLIPSTREAM) OFF OF AH. CAR AHEAD"
1030 PRINT "OF YOU., (BU'"! NOT MORE':'THAN 1 SECOND AHEAD). TO DO THIS'
~lfM8ER+l000 AS YOUR SPEED."
1050 RANDOMIZE
'
,
lJ50 IF' AS'"YES" THEN lliO
1070 FRINT 0$(0)
1080 PRIST "FOR INSTRUCTIONS, PLEASE TYPE LIST AFTER THE COMPUTER SArs READY."
1090 PRI~!
ll00 IF AS-"NO" rHEN 2290
1110 LET F2-INT(RND*10)+6
1120 FOR A.JTO 09
'~SSIGN NUMBERS AND ADHESION FACTORS
1130
PRINT, O$(A);"rOUR DRIVING NUMBER IS";F2*(A+ll+A 'AEHESION FACTOR IS HO'.£1 YOUR CAR GRIPS THE ROAD
1140
LET AH)-RND*.05+.05
1150
PRINT O$(A);"HHESION FACTOR";;;(A)*100-5;". (THE LOWER THE BETTER)"
1150 ~EXT A
1170 PRINr 0$(10);"YOUR MAX. SPEED IS 200 MPH. TO SEE STANDINGS INPUT"
1180 EFINT "0 AS YOUR SPEED"
1190 PRI~r 3$(0);"WOULD ~OU LIKE TO SEE THE COURSE";CHR$(63*SGN(09));0$; 'PRINT
IF ULT-TERM. OTHERWISE DON'T
1200 MAT INPUT AS
1210 PRIN! 0$ (10);
12Z0 LET A$=AS(NUM)
1230 GOSrR 2190
1240 IF AS."NO" THEN 1450

DiD PRINr "TYPE HIS CAR

68

1250
1250
1270
1280
1290
1300
1310
1320
1330
1340
1350
136J
1370
1380
1390

~S<>"YES" THEN 1190
______ r
'PRINT COURSE
FRIITTAB(3);"/1";TABC11);"B";TIEC19);"2\"
PRINrTAB(2);"/A";rRBC20);"C\"
FRIN7TABCll;"";TAB(22);"\"
PRINr "1";T~BC211;"3I"
PRINT "'-SIART*FINISH";TAB(22);"I"
?RINT "A"iT!\B(22):HI"
FRINT "'";T~B(21);"tI"
?RINr "1\11:TJ\B(22)i"I"
FRINT "'";IAB(22);"I"
PRIN'r "I\H" iTABe 22);" In
?RIN'r "1\1I;T.~B'22);nI"
PRINT "'";TIB(21);"4I"
PRINT "A";TRB(16);"
/"

IF

PRINrI~B(4);"----------

1400 FRINT"J\8"iTABClS);"Tr'E"-

1410 PRI~T "I\" i TAB(16);"\"
1420 PRINT "\" ;IABC 17);" -----------)" ;CHR$ (13) ;TAB C20);" IP ITS\"
1430 FRIN'I " \7";TAB(l41;"G":TAB(Zl);"FA " ;TAB{Z7);1I6I"
1140 ~RUr" \
I"
1450 LET N=RND*3~r---------------------

1450 °RVa"
~OTE:

THIS IS .";INTCN);"LAP RACE."

1470 PRI"IT"

&ENTLEMU, START YOUR HGINES! THE GREEN GOES DOWN P.ND"
1480 FRIN I"OFF YOU GO!"
1490 DATA STRAIGHT,HAIRPIN,CURVE
1500 DAn ~AY I SHOW YOU TO A PLOT? WE HAVE A NICE CHOICE OF HEADSTONES.
1510 LET Q=-1
1520 LET ~=INTCN)
1530 FOR V=1 TO ~
'WORKING PORTIO~
1540
LET Y=FNACM$Cl),2JO,l,3/10,b51 'STRAIGHT A, 200 ~AK., 3/10 MILE LONG
1550
LET Y=HACM$(3),125,I,l/l0,49) 'CURVE 1. 125 MAX>., 1110 ~ILE LONG
1550
LET Y=FNAC~$Cll,2~O,2,13/20,65l 'STRAIGnT B, 200 MAX., 13/20 MILE LONG
1570
LET Y=FNACM$(3),125,l,1/10,50) 'CURVE 2, 125 MAX., 1/10 MILE LONG
1580
LET Y=FNHM$Cll,200,I,l!5,67)
'StRAIGHT C, 200 r.AX., lIS MILE LONG
1590
LET Y=FNACM$(3),150,I,3/20,511 'CURVE 3,150 MilK •• 3/20 MILE LONG
HOO
LET Y=FNACM$(l),200,2,3/S,68)
'STRAIGHT D, 200 MAX., 3/5 MILE LONG
>1&10
LET Y=FNACM$(3),125,1.1IlC,52) 'CURVE 4, 125 MAX., 1110 MILE LONG
1520
LET !=FNACM$Cl),230,l,1/4,69) 'STRAIGHT E, 200 MAX., 1/4 MILE LONG
1630
LET Y=FNAH1$CZ),100,.75,3/20>,53) 'HURFIN 5, 100 II~X., 3/20 MILE LONG
1643
LET Y=FNACM$Cll,200,1.5,9!20,70) 'STRAIGHT F, 200 MAX., 9/20 ~ILE LONG
1550
LET Y=FNACMS(2),100,.75,3/20,54) 'HAIRPIN 5, 100 MRX., 3/20 MILE LONG
1660
LET Y=FNAC~$Cll.200,2,l,71)
'STRAIGHT G, 200 MAX., 1 MILE LONG
1570
LET Y=FNACII$C 3),125,1,1/10,55) 'CURVE 7, 125 MH., 1/10 MILE LONG
1660
LET Y=FNACM$(3),150,I,3/20,56) 'CURVE 8, 150 Mn., 3/20 MILE LONG
1690
LEI Y=FNACM$Cll,200,2,71l0,72) 'STRAIGHT H, 20e IIAX., 7/10 ~ILE LONG
1700
IF V=H THEN 1740
1710
LET Y=FNAC·START-FINIS~ CCURVE 9)",150,1.3/20,127)
1720
REM
NAIIE OF TRACK
,MAX,.,LEN ,ASC
1730
REM
START-FINISn, 150 MAX •• 3/20 MILE LONG
1740 !,EXT V
1750 IF Gl=l THEN 2040
'ALL ~HD?
1760 PRINT O$C 10 );"DO YOU MEAN THAT EVERYONE ISN'T DEAD? WELL. HERE ARE" 'NO, SO PRINT OUT RESULTS OF RACE
1770 ?RINr"THE RESULTS STRAIGHT FROM THE CHECKERED FLAG:
1780
1790
1300
1810
1820
1230
1340
1850
IdSO
1870
1880
1990
BOO

BID
1920
193D
1940
1950
1960
1370
1980
1990
2UOO
2010
2020
2030
2040
2050
2063
2070
2J80
2090
2100
2110
2120
2130
214J
2150
2150
2170
2180
2190
2200
2210
2223
2230
2240
2250
2260
227J
2260
2290

LEr .=lE+37
IF 09=0 THEN 1820
LET :;5=09
GeTO 1830
~E1 :;5= 3
FOR Z=O TO G5
IF 09>0 THEN 1880
IF Z=O THEN 1880
PRI~T .$CZ);
GOTO 1890
PRI~T"GUY n";F2*CZ+ll+Z;
IF DCZ)=D THEN 1950
PRINT" IS LOOKI~' AT THE~ PE~RLY GUES."
IF 09=6 TnE~ 1990
PHNT GSCZl;"TELL ST. LUCIFER NOT TO EXPECT ME. O.X.?"
PRINT 3$CI0);
GOTO 1390
PRINT"TOOK";TCZ);"SECONDS. WHICH AVERAGES OUT TO";3600*5.3*H/!CZ);"MPH" 'T ARRAY IS
IF TCZ ». THEN 1990
LET .=T CZ)
'NEW LEAD ING TIME AND DRIVER
LET N=F2*CZ+l)+Z
HX! Z
IF 03>0 THEN 2020
IF N>F2 THEN 2040
PRINI OSCCN-F2)/CF2+11);"NICE RRCE, ~R";N
PRINT 0$ ClO);"AND THAT MEANS THAT GtY n";N;"YiINS!!!"
PRINr O$CO);"ANOTHER R~CE";CHR$C&3*SGN(09) );0$;
~AT INFUT AS
LEr A$- A$C NUM)
GOSUB 2190
IF AI="NO" THEN 2290
IF ASo"YES" THEN 2040
FOR ZoO TO lU
'RESET FOR NEXT GAME
LoT TC Z)=DCZ)=O
~Exr

Z

PR!};T OS (10 );"NEA SET-UP.
IF Gl=O TriES 2160

NO RAIN, NO DEBRIS";
'IF EVERYSODY'S DUD, BE NASTY.
PRINT ", ANt CPLEASE!) BETTER DElVERS."
PRINr
LET Gl=F5=0
'UNKILL EVERYBODY AND UNeIL THE TRACK
:;lTO 1110
FOR X=1 TO K9
'FOREIGN LANGUAGE H~NDLE~
IF A$=F$CX) THEN 2230
NEXT X
GO TO 2280
PRINT J$CO);R$CCX-1l/2+!)
IF X=INTCX/2)*2 THE~ 2270
LeT 1\$=nNO"
GOTe 2280
LET ~$="YES"
~ETliRN

STOP

69

TI~E

ARRAY

CONTROL FUNCTION
2300
2310
2320
2330
2340
2350
2360
2370
2380
2390
2400
2410
2420

24B

2440
2450
2460
2470
2480
2430
2500
2510
2520
2530
2510
2550
2550
2570
2580
2590
.2600
2610
2520
2E30
2640
2550
2660
2670
2680
2690
2700
2710
2720
2730
2740
2750
2760
2770
2780
2790
2900
2810
2320
2830
2840
2850
2850
2870
20BO
2990
2900
2910
2920
2930
2940
2950
2960
2370
2380
2990
3000
3010
3020
3030
3040
3aso
3060
3]70

DEF FNACA$,R,B,C,D)

'KIND tUCK, MAX. SPEED, ADHESION FUDGE FACTOR, LENGTH
'ASCCLETTER FOLLOWING KIND OF TRACK)

IF G1=1 THEN 4250
'ALL DEPot?
Gosua 2800
'GET SOME ~AZARDS CIE RAIN, OIL)
GOSUB 3220
'GET EVERYONE'S SPEEr
Fn G=O TO 09
'CHECK FOR SHE SPEEDS
IF DCG )=1 T~EN 2780
If CB+ACG)+E)kSCG)/B<=R.·Cl+RNDk.ll THEN 2500
PRINT O$CG);X$
'PRINT DEAD MESSAGE
LET F5=F5+1
'INCRE~ENT OIL CJUNTER
LET ECF5)=D
'AND THE 635 SAIO "LET THERE BE OIL." AND THERE IT WAS.
FOR ZoO TO 09
'AND THE TRACK ABOUNDED WITH OIL. AND THE 635 SAID "BOY, WHAT
IF Z=G THEN 2450
'A MAN TRAP!"
PRINT O$CZ);"GUY #";F2*CG+ll+G;"JUST WIPED REAL GOOD C'N DEAD!)" 'IN THE MEANTIME, IT HAS BEEN BUSY NOTIFYING PEOPLE
NEXT Z
'OF THEIR COMRADE'S DEMISE.
LET DCG)=1
'OFFICIALLY PRONOUNCE DEAD. D IS'FOR DEATH
LET Q=Q+1
'INCRE'ENT DEAD COUNTER
IF 0=09 THEN 4230
'EVE.RYBODY DEAD?
GOTO 2780
LET Y4=TCG)
'RATS. HE DlDN'T WIPE
IF CB+ACG)+E)'SCG)/B<=R THEN 2530
PRINT O$CG);"NEARLY HAD TO SAY GOOD BYE." 'ALMOST WIPED
LET TC C)=TCG)+CIC SCG)/3600)+LC G) 'UPDATE HIS TIME
IF 09>0 THEN 2660
'SEE IF, HEAVEN FORBID, HE PASSED SOMEBODY
FOR X4=1 TO 3
IF DC X4) =1 THEN 2650
LET Z4=TC X4)-C C/cSCX4 )/3600»
LET ZI=Y4-Z4
LET Z2=TCG)-TCX4)
IF SGNCZ21<>-SGNCZl) THEN 2650
IF SGNCZ2)=1 THEN 2640
PRIN! "YOU JUST PISSED ";Q$(X4)
GOTO 2650
PRINT Q$CX4);" JUST PASSED YOU".
~EXT X4
FOR X4=G+l TO 09
IF DCX4)=1 THEN 2770
IF SCX4)=0 THEN 2770
IF SGNCY4-TCX4»=SGNCICG)-CTCX4)+CICSCX4)/3600») THEN 2770
IF SGNCTCC)-CT(X4)+C/CSCX4)/3600»)<>-1 THEN 2740
PRINT 0$CX4);"GUY";F2 k CG+ll+G:"JUST PUSED YOl."
PRIN! 0$ CG I; "YOU nST PASSED GUY"; F2.C X4+11+X4
GOTO 2770
IF SGNCTCG)-CICX4)+crCSCX4)/3600»)=0 THH 2770
PRINT 0$CGI;"OUY";F2 k CX4+11+X4;"JUST PASSED YOU."
PRINT 0$CX4);"YOU JUST PASSED GUY";F2*CG+l)+G
NEXT X4
HXT G
'PROCEED TO THE FATE OF THE NEXT VICTIM
GOTO 4250
'NO MORE VICTI~S. CTHIS TIME!!>
RE:w!

~I\Z.I\RD3

FRI:;T 0$(10);
E=u
'~~KE SURE WE DO~'T 1SE LAST SECTION'S OIkON T6IS SECTION
~AT L=ZER
'KILL PIT STOPS FRO~ LAST TIME
LET LC 0) =0
IF F5<2 THEN 2900
'IF COURSE WELL GREASED, DISSOLVE GREASE
PRnn "THE RED FLAG HAS BEEN PUT OUT. CARS REMAIN"
PRINT "MOTI CNLESS UNTIL DEBRIS IS CLEARED"
HT E=ZEI
LET F5=0
FOR X=1 TO f5
'SEE IF THOSE PLAYING DESERVE OIL
IF ECX)=D THEN 2940
HH X
GOTO 2970
PRP{IItYIKES!
OIL ON THE TRJ!.CK!"
'IF SO, MTIFY SURVIVORS AND OTHERS
LET !:=.2
GOTO 3130
IF Fl=l THEN 3130
'HAVE tiE HAD RAIN?
IF RND>.025+GB THEN 3130
'SEE IF IT SHOULD BE STOPPED OR STARTED
IF ACOk.l THEN 30BO
'IS IT RAINUG?
IF IND>.5 THEN 3130
'STOP IT?
FRINT "GLORY BE, THE RAIN HAS STOPPED! BUT REMEMBER IT IS STILL WET"
LET Fl=l
'RAIN, RAIN, GO AWAY, .ON'T COME BACK ANOTHER DAY
FDR 1=0 ~u
LET ACA)=ACA)-.075
'DELETE "OST OF THE EFFECTS
LET G8=.025
'~RKE IT LESS LlKELY TO RAIN IN LATER RACES
HX1 A
GHO 3130
~ .• T

J,

3 aBO PRI;"l "f:AIN!

3090
3100
3110
3120
3130
3140
3150
3160
3170

1 _ _ _ _ .... _ _ _ _ _ _ _ _ _

FOR

SLOW tOWh!!"

TO 09
LET Ac"A)=ACA)+.1
LET 08=.1

~=D

'HALLELUJAH, MY J.;lUN DANCE WORKED
IRHK SLIPilif Y

'~AKE

NEX! A
IF C<>9/20 rHEN 3210

'PI T STOPS?
IF RND <.125 THEN 3210
PDR ~=Q TO 09
IF RND*SGN(09)<.75 THEN 3200
IF DC X) =1 THEN 3200
31BO
LET LC X )=RND*3+5
3190
PRINT O$CX);"~OU AlE IN THE PITS FOR";LCX);"SECONDS."
3200
'ilE ilUZ HERE CAND LEFT!)
3210 ~gJR~
3220 REr. INPUT
3230 'AT S=ZER
'RESET SPEED ARRkY
3240 IF 03>0 THEN 3270
'PRINT OUT SOMETHING LIKE 'STRAIGHT A'
3250 PRINT A$;" ";CHR$CD);
3260 GJTO 3280
3270 PRINT O$C 10 );A$;" ".;CHR$CD);": ";0$;
3230 LET SCl)=O
'GET EVERYBOOY'S SPEEDS
3290 FOR ~=O TO 09
3300
IF DCA )=0 THEN 3330
3310
PRINT O$CA)
'IF HE'S DEAD, DON'T GIVE HIM A CHANCE TO' INPUT
3320
PRINT 0$;
3330 NEAT A
3340 HI INPUT J
'INPUT SOMEBODY'S SPEED
3350 IF NUM=1 THEN 3390
'SOMEBODY TYPED SOMETHING. SET UP SPEED AND TTY#
3350 LET N=JCll
3370 LET S=JC 2)
3380 GJTO 3ED

70

3390
3400
3410
3420
3430
3410
3450
346~

3470
3480
3490
3500
3510
3520
3530
3540
3550
3560
3570
3530
3590
3600
3511
3620
3630
3640
3550
366)
36711

3'6RO
3&90
3700
3711
3720

3730
3740
3750

3760
3770
3780
3790
330U
3810
'3820
3830
3HO

3850
3%0
3070

33HJ
389r
330)
3910
3920
3930
3'HO

3950
3960
3570
3980
3990
(00)
4DIO
4020
4030
401l
4050
4060
4070
4080
4090
4100
4110
4120
4130
4140
USO
4160
4170

m~

LET S=JU I
LET 11=0
IF DIN)=O THEN 3450
'IS THE GUY DEAD?
PRINT' JIS(N);nBUT I THOUGHt: YOU ij,ERE DEAD.· 'RE-INFORII HIli THAT HE IS AN UN-P,ERSON
PRINT 0$;
GJITO J.340
IF SIN)=D THEN' 3480
'HAS THIS GUY ALREADY TOLD US HIS SPEED?
PRINT 0$ IN) ;"WArT l\ SEC. I ST,I\.L KEED";09-U-Q.;"IIORE. SPEEDS." ~TELL HI~, TO BUZZ OFF
G31103430
LETR=N
IF 5<=200 THEil 36Z0
'DID HE TRY TO EKCEED HIS' !lAX. SPEEr:!
IF 09=0 THEN 3600
IF 5<1000 THEN 3600
LET R4=IS-I000-F2)11 F2+11
'IT'S OK. HE ONLY WANTS TO DRAFT
IF R4=INTCR4) THEil '3560
'NOW SEE IF HE PICKE] A LEGAL CAR
PRINT O$CNl;"ILLEGAL CAR"
'HE DIDN'T
GOTO 3640
IF R4>J9 THEN 3540
IF tCR4l>0 THEN 3540
IF nBSCTCNl-TCR4l-.5)'=>.5 THEN 3540
GJ:TO noo
'HE DID!!!
PRINT O$CIIl ;"MAYBE A LITTLE HARD ON THE PEDDLE? BE REAlISTIC •• 'OPII!lI:ST
GJTO 3640
IF 5>0 THEN 3660
GOSUB 3990
'HE WANTS TO SEE HOI HE'S DOING. POOR GUY
PRINT "HOW FAST";CHR$C63*SGN(09)};0$;
Goro 3340
IF 5=>20 THEN 3690
• WHERE DOES HE THINK H,E IS? THE LOf';:-I,S~D,
PRINT 0$ CNl ;"1 DaUB!. YOU WRIIT TO GO THAT SLOWLY"
~1Tn 3640
LET 5CII)=S
LET U=1J+1
IF R4=O THE~ 3740
LET ),(Nl=R4
'IF HE'S DRAF!ING, TELL ~E TO
L[T H=C
'ARE WE rONE?
If t<09-Q THEN 3430
I YES!
LET U=O
'SET SPEEDS FOR AU'fO-PILCTS
IF C9>O THEN 3890
FlR FO=l TO 3
,
If DCFOl=l THEN 3870
LET S =R'B/C B+.1>E+G8 1 +C RNl)*3+QC F,O II
IF CB+.l+GB'tEI*S/B<=R THEN 3850
LET DCFOl=l
PRINT O$ClO);Q$CFJ);" JUST .IPED" 'nND INFOR~ us IF THEY oIP£',
LET F5=F5+l
LET ECF5)=D
LET TCFOl=TCFOl+CICS13600l
LET SCFOl=S
NEXT FO
,JTO J9liO
'NOW HANILE DRAFT.ERS
FOF X2=O TO 09
IF ,DCX?)=l THEN 39,.70
IF SCX21<>0 THEN 3970
IF S(,HIX2.ll<>0 THEN '3950
LET Hn2l=HCHIX211

Go'ra 3920

LET SCX2l=SCHCX21l
'SET HIS SPEED TO ,HIS DRAFTEES, AND
LET TCX2l=CTCX21+rCHIX21ll/2 'HALVE THE DISTANCE BETWEEN THEM
NEXT X2
RETURN
'NOW GO COUNT SURVIVORS AND INCREIIENX TIME'S
REM PLACING
PRINT O$lAl
'TELL ME HOW I'll DOnG
IF 09=0 THEN, 4040
1.ET ,5=09 '
GOTO 4050
LET ;:5=3
FOR '0=0 TO G5
IF G=A THEN 4200
IF 09>0 THEil 4100
'I All RACING, AGAINST AUTO-PILOTS
PRINT Q$(GJ;" IS";
GOTO 4110
PRINT "GUYH";F2*'CG+ll'+G;"IS"; 'I All RACING AGAINST FRIEIIDS!?l
IF DCG.l<>l THEN 4140
PRINT" OUT OF THE RACE.·
'IF COMPETITOR HAS MET HIS MAKER, S~y SO
GOTO 4200
ON SGNCICA)-tCGll+2 GOTO 4150,4170,4190 'BUSINESS ,PART
PRINT r !Gl·TC A)';"SECONDS BEHIND YOU· 'COOD NEWS
GOTO 4200
PRINT" RIGHT BESIDE YOU."
SO SO

~~i~T 4~~~HC

Gl ;"SECONDS AHEAD OF you." 'BAli NEWS
4200 NEXT G
4210 PRINX"
YOU'VE TAKEN";TlAl;"SECONDS." 'MORE BAD NEWS
4220 RETURN
'AND AN AIITI-CL-IMACTIC ElIDING. CSTOUN FROM SPIEL*** AND SPACEWARl'
4230 PRINT 0$(10 );"GUYH";F2*CG+ll+G;", THE LAST OF THE GREAT RACERS, JUST WIPED."
4HO LET Gl=:1
'ALL HueANS ARE DUD, SO GRIND THIS MAIIGLE TO A HALT, AND SET A FLAG TO THAT EFFECT
4250 FNEND
',AND RETURN, FROII WHENCE liE CA"E
425'0 END
REAU

71

I·
I

CHANGE

COMPUTER IMITATES CASHIER

Description
In this program, the computer pretends it is the cashier at
your friendly neighborhood candy store. You tell it the cost
of the item(s) you are buying, the amount of your payment, and
it will automatically (!) determine your correct change. Aren't
machines wonderful?
Program Author
Dennis Lunder
People's Computer Co.
Menlo Park, CA 94025
2 PRINT "I, YOUR FRIENDLY EQUS'STEM cOMPuIER, WILL DETERMINE"
3 PRINT "T~E CORRECT t~ANGE FOR tTEMS COSTING UP TO 1180,"
• PRINT\PHINT
I. PRINT "COST OF ITEH"'\INPUT 'A\PRINT ·AMOUNT OF PA'"ENT"'\INPUT P
21 COp-A\Moe\IF cc.e TMEN ee \PRINT "CORRECT AMOUNT,TMANk yOU'
31 GO TO 1111
91 IF c-e THEN 121 \PRINT "SORR',yOU HAVE S~DRT e~ANGED ME S"'A-'
lea GO TO 10
128 PRINT ·YOUR CMANGE,S·,t\D.INTCC/I,)\IF Doe THEN t55
15e PRINT O,"TEN DOLLAR BILLeS)"
155 COM-CP.18)\EOINTCC/5)\IF Eo~ THEN 185
lee PRINT E,"FIVE DOLLAR SILLCS)"
185 COH-CO.IIII.E.5)\FotNTCC)\IF Foe T~EN 215
211 PRINT F'"ONE DOLLAR BILLCS)"
215 COH-(O.IS+E.e.F)\Coe.lea\NoC\GoINTCC/SI)\IF Go, THEN 255
2S8 PRINT G"ONE-~ALF DOLLAR(S)"
255 C.N_CG.'8)\H o XNTCC/251\IF H'~ THEN 285
2.8 PRINT H";UARTERCS)"
285 CON -CG.5a.H.25)\loINTCC/I.I\IF 10' THEN 315
318 PRINT I)"OIME(S)"
315 CON-(G.oe.~.25.I.18)\JoIN,(C/5)\IF JW' TWEN 3~5
348 PRINT J'"Nlt~EL(S)"
345 eoN-(G.e,.H.25+I.le+J.e)\KoINT(C.,5)\IF Ko' T~E~ 380
378 PRI~T K,"PEHNY(S)"
388 PRINT "TWANK VOU,COM~ AGAIN"\PRINT \PRINT \GO TO 10
9Vg END

I, YOVR FRIENDLY EDUSYSTEM COMPUTER, WILL DETERMINE
THE CORRECT CHANGE FOR ITEMS COST I NG UP TO $100.
COST OF ITEM? 4.59
AMOUNT OF PAYMENT? 10
YOUR CHANGE,S 3.41
.
1 FIVE DOLLAR BILL(S)
1 QUARTER(S)
1 DII'IE(S)

1 NICKEL
1 QUARTER ('$ >
1 NICKEL14.5+13.,5*GII THEN 9600,
,9500' LET 0-0+2
'
9600 IF X'~14.5-13.5*GII THEN 9800 '
9700LET g-g-2
960,0 REM
990011" U' •• THEN 10100
100000'LET g-Q+I
10100 IF U'~8 THEN 10300
10200 LET g-II+I
10300 FIR C--ITII STEP 2
10400 IF SIU+C.V+Glcl THEN .10800
10500 LET g-g-I
10600 IF S1=-1
REM PRINT THE BOARD
PRINT
PRINT TAB(7); "1 2 3 4 5 6 7 8 ~'
fOR 1=1 TO R
PRINT I;TAB(7);
FOR J=1 TO C
If A(I.J)=-1 THEN 700
IF A(I.J);0 THEN 720
PRINT ".
GOTO 710
PRINT "P ";
NEXT J
PRINT
NEXT I
PRINT
IF f=0 THEN 770
RETURN
REM GET CHOMPS FOR EflCH PLA\'ER· I N TURN
LET 11=11+1
LET P1=I1-INT

1010
1920
1830
1840
1850
1960

YOU' RE.1RyING TO CHOMP. ON

1
2

* * • • ...
* ... * * ...
". * ,* * . . *
*... *.,. ...". ....,. ** *.,.

P ...
...

~

1

".

4
5

".
...

THE BOARD IS A BIG COOKIE - R ROWS HIGH AND C COLUMNS
WIDE. YOU INPUT RAND C AT THE START. IN THE UPPER LEFT
CORNER Of THE COOKIE IS A POISON SQUARE (P). THE ONE WHO
CHOMPS THE POISON SQUARE LOSES. TO TAKE A CHOMP. TYPE THE
ROW AND COLUMN OF ONE Of THE SQUARES ON THE COOKIE.
ALL OF THE SQUARES BELOW AND TO THE RIGHT OF THAT SGlUARE
(INCLUDING THAT SQUARE. TOO) DISAPPEAR -- CHOMP!!
NO fAIR CHOMPING SQUARES THAT HAVE ALREADY BEEN CHOMPED.
OR THAT ARE OUTSIDE THE ORIGINAL DIMENSIONS OF THE COOKIE.
HERE WE GO ...
HOW MANY PLAYERS? 2
HOW MANY ROWS? 4
HOW MANY COLUMNS? 7

1
2

3

4

1 2 3 4 5 6 7 8 9
P * ......

* "" .,. * ...
* ... *_If<'" * ...

* * ... * * ... ...

PLAYER 1
COORDINATES OF CHOMP (ROW. COLUMN)? 4.6

1 2 3 4 5 6 7 89

1
2
3
4

";

P ...

*... *...

* ... ... ... *
". * * ... *

... ... ... ... ...

... ... ... ... ...

PLAYER 2
COORDINATES OF CHOMP (ROW. COLUMN)? 3.3
1
2
3
4

1 2 1 4 5 6 7 8 9
P ..

..

...

...

*

*

... ... ". ". *
...

...

".

".

".

PLAYER 1
COORDINATES OF CHOMP (ROW. COLUMN)? 1.4

1
2
3
4

...
....

1 2 3 4 5 6 7 8 51
P

PLR-YER 2"
COOR.DINIlTES" OF.CHOMP (ROW. COLUMN)? 3'11
1
2
3
4

1 2 3 4 5 6 7 8 9
P .. *

' ...

*.~-:ii:c

PLAYER 1
"COllRDINATES Of CHOMP (ROW. COLUMN)? 2. :;:

1
2

.. :;:

~

2 3 4 5 6 7 8 9

..

*

p ....

*

:4

:PLAYER 2··
C(lORDINA"TES OF CHo.I1P" (j;!OW. COLUMN).?,1;:;:

E~~t\::S:PAC;"!'

. 1"2

1

P ..

2"

'" ...

%4

5 6 7

8,~

3
4

~INE

OF GAME D.ETtCTEl> I"N
PRINT "YOU LOSE. PJ,A'i'ER "; P1::C·
PRINT
.
PRINT "AGAIN (1=VES; 0=tlO'! )'J"
INPUT R "
.
If R=1 THEN 340
END

JAN 1973)

HERE'S HOW A BOA·RD Looks. (THIS: ONE IS 5 BY· 7) :

F=1

360 F=0
370
372
375
377
379
388
398
489
418
428
439
449
459
468
479
489
499
598
510
530
540
550
560
570
589
599
600
610
623
630
640
650
660
673
680
698
700
710
723
730
740
750
760
770
780
790
800
810
823
830
848
858
869
870
880
899
999

THIS IS THE GAME OF CHOMP (SCIENTIFIC AMERICAN.
~ANT THE RULES (1=YES. S=NO!)? 1
CHOMP IS FOR 1 OR MORE PLAYERS (HUMANS ONLY).

PLAV.ER 1
COORDJNATES OF. .CHOMP . (R"W;COLVIIN)? 2.2
9.00

1
2
3·

1 2 3 4
P ..

5

..

4

PLAYER. Ii!
. "
""
COORDIN",TES Of CHOMP (~OW. COLUMib·? 1.2

READY

1

1.2345678 S
.p .

2

*,

1
4

~~~~~NA~ES

OF CHOMP (RO),l. COL(fMNl? 2.1

1 2 1 "4,·5 67 $ 9 .
P

79

PLAYER 2
COORDINATES OF CHOMP (ROW. COLUMN)? 3.1
NO FAIR. YOU'RE TRYING TO CHOMP ON EMPTY SPACE!
PLAYER
2
COORDINATES OF CHOMP (ROW. COLUMN)? 1.1
I'OU LOSE, PLAYER 2

I

~

:~

CIVILW

CIVIL WAR GAME

Description
This simulation is based on 14 battles in the Civil War. Facts
and figures used are based on the actual occurrence.
If you
follow the same strategy used in the actual battle, the results
will be the same--generally, this is a good strategy since the
generals in the Civil War were fairly good military strategists.
However, you can frequently outperform the Civil War generals,
particularly in cases where they did not have good enemy intelligence and consequently followed a poor course of action.
Naturally, it helps to know your Civil War history, although,
the computer gives you the rudiments.
After each of the 14 battles, your casualties are compared to
the actual casualties of the pattIe, and you are told whether
you win or lose the battle.
.
Program Author
CIVIL WAR was written in 1968 by three students:
L. Cram, L. Goodie, D. Hibbard
Lexington High School
Lexington, MA 02173

80

PROGRAM LISTING
I ~ET ~.01~ET w.01~ET RI.01~ET PI.0
2 ~n QI'01~ET ~3001~ET "4-0
3 lET P2 0 01lET T,oellET T2 0 0
5 REMARKAB~E PROGRAM BY ~, CRA" • ~. GOODIE • AND 0, ~IBBARD
6 PRINT "DO YOU WANT DEsCRIPTIONS C0 oYES. I'NO)"'
1 INPUT Z
9 FOR Uo' TO 6
10 PRINT
II NEXT U
13 IF Z'I THEN 100
15 PRINT "TMIS IS A CIVIL WAR SIMULATION,"
"
20 PRINT "TO PLAY. TYPE A RESPONSE ~HE~ THE COMPUTER ASKS.
U PRINT "REMEMBER THAT AlL FACTORS ARE INTERRELATED AND THAT YOUR"
35 PRI~T "RESPONSES COU~D CHANGE HISTORY, FACTS AND FIGURES USED ARE"
40 PRINT "BASED ON THE ACTUA~ OCCURENCE, MOST BATTLES TEND TO RESULT"
45 PRINT "AS THEY 010 IN THE CIVIL WAR. BUT IT ALL DEPENDS ON YOUII"

g~ :=~~~

"THE OBJECT OF THE GAME IS TO 7. THEN 1150
1110 PRINT 'MuRFREESBORO"
1120 IF .AI'I THEN 1480
1130PRINT"DEC 3101862
THE SOUTH UNDER GEN, BRAGG .ON A CLOSE BATTLE"
1140 GOTO 1480
1150 IF Aoe T"EN 1200
1160 PRINT "CHANCELI.ORSVIlLE"
1110 IF AI' I THEN 1480
1180PRINT"MAY 1-6,1863
T~E SOUTH HAD A COSTlY VICTORY AND LOST ONE"
lIe2PRINT"OF THEIR OUTSTA~DING GENERAI.S, 'STONEWALL' J4CKSON,"
II n GOTO 1480
1200 IF A<.9 THEN 125~
1210 PRINT "vIC~SBURG"
1220 IF AI'I THEN 1480
123BPRINT"JULY 401863
vICKSBURG WAS. COSTLY DEFEAT FOR THE SOUTH"
1232PRINT'SECAUSE IT GAvE T~E OJNION ACCESS TO THE "ISSISSIPpI."
1240 GOTO 14S0
1250 IF AOU THEN 1300
1260 PRINT 'GETTYSBURG'
1210 IF AI'I T~EN 1480
1280PRINT"JUNE 30.1863
A SOUTHERN MISTAKE BY GEN, LEE AT GETTYSRURG"
12S2PRINT"CoS T THEM ONE OF THE MOST CRlIClA1. BATTLES OF THR "AR,'
1290 GOTol480
1300 IF .0011 THEN 13b0
1319 PRINT "CHICKAMAUGA'
1320 IF _1'1 THEN 14S0
1330PRINT"NOV 25.1863
AfTER THE SOUT~ HAD sIEGED GEN, RoafNC.ANS'"
1332PRINT"ARMY FOR THREE MONTHS. GEN, GRANT BROKE THE SIEGE."
1340 GOTO 1480
1350 IF AOl2 THEN 1400
13e0 PRINT "CH.ATTANOOGA"
1310 IF AI.I THEN 1480
1380 PR INT'SEPT .15,1863
CONFUSION IN A FOREST NUR CHICK.,IAUGA LED"
1382PR!NT"TO A COSTLY SOUTHERN VICTORY,"
1390 GOTO 1480
1400 IF A"\3 T~EN 1450
1410 PRINT "SPOTSYLVANIA"
1420 IF AI'I THEN 1480
1430PRINT"MAY 5.1864
GRANT'S PLAN TO KEfp LEE ISOLAT~D REGAN TO FAIL"
1432PRINT'HERE. AND CONTINUED AT COI.O HARBOR AND PETERSBURG,"
1440 GOTO 1480
1450 PRINT "ATLANTA"
1460 IF Ahl THEN 1480
141ePRINT'AUGUST. 1864
S~ERMAN AND THREE VETERAN AO"lES. CONVERGED ON"
1412PRINT"ATlANTA AND DEAlT T"E.OEAT~ BLO. TO THE CONFEDERACV,"
1480 PRINT
1485 RETURN
1487 PRPlT "T~E CONFEDERACY HAS SURRENDERED"
1488 GOTO 1600
1490 PRINT "THE UNION HAS SURRENDERED"
1500 PRINT
151~ PRINT 'YOU HAVE WON" W, "SATTLES ANO LOST' L, "BATTLES,"
1515 IF y., THEN !·5b0
1520 IF wcoL THEN 1550
1530 PRINT "THE CONfEDERACY HAS WON THE WAR"
1540 STOP
1550 PRINT 'THE UNION ~AS WON THf wAR'
1560 END

TH I SIS THE BATTLE OF CH I CKAMAUGA
NOV 25,1863
AFTER THE SOUTH HAD SIEGED GEN. ROSENCRANS"
ARMY FOR THREE MONTHS, GEN. GRANT BROKE THE 5IEGE.

l=NOI? 0

DO YOU WANT DESCRIPTIONS Ie-YES.

SAMPLE RUN
MEN
li0NEY
INFLATION

THIS IS A CIYIL WAR SIMULATIO~
TO PLAY, TYPE A RESPONSE WHEN THE COMPUTER ASKS.
REMEI1BER THAT ALL FACTORS ARE INTERRELATED AND THAT YOUR
RESPONSES COULD CHANGE HISTORY. FACTS AND FIG'JRES USED ARE
BASED ON THE ACTUAL OCCURENCE. MOST BATTLES TEN!) TO RESULT
t~S THEY DID IN THE CI\'IL WAR, BUT IT ALL DEPENDS (IN ,'(Ill!!

UNION
$

62140
294000

2 X

MORALE IS FAIR
1lOTH SlIiES ARE ON THE OFFENSIVE
YOUR STEGY? :t

,'OUR CHOICES FOR DEFENSIYE STRATEGY ARE,
(1) ARTILLERY ATTACK
(2) FORTIFICATION AGAINST FRONTAL ATTACK
(3) FORTIFICATION AGAINST·FLANKING MANU EYERS
(4) FALLING BACK
YOUR CHOICES FOR OFFEI~SIVE STRATEG,' ARE:
(1) ART I LLERY ATTACK
(2) FRONTAL ATTACK
(]) FLANKING MANUEVERS
(4) ENCIRCLEliENT
YOU MAY SURRENDER BY TYP I NG A '5' FOR YOUR SH:ATEG,'.

CASUAL TIES
DESERTIONS

CONFEDERACY
18173

13

UNION
13471
36

YOUR CASUALTIES WERE 1 Y. MORE THAN
THE ACTUAL CASUAL! TI ES AT CH I C'KAMAUGA

'IOU LOSE CHICI(AMAUGA

GOOD LUCK!

YOU ARE THE CONFEDERACY.

THIS IS THE BATTLE OF CHATTANOOGA
SEPT 15,1863
CONFU.5ION IN A FOREST NEAt? CHICKAMAUGA LED
A COSTL'( SOUTHERN VICTORI'.

oro

THIS IS THE BATTLE OF BULL RUN
JULY 21, 1861
GEN. BEAUREGARC' COMMAND I NG THE SOUTH MET THE
UNION !'ORCES WITH GEN MCDOWELL IN A PREMATU~:E BATTLE AT BULL
RUN.
GEN. JACKSON HELPED PUSH BACK THE UN I ON ATTACK.
CONFEDERACY
18000
$ 81000
25 Y.

270600
BY.

HOW MUCH DO YOU WISH TO SPEND FOR FOllD? 80000
HOW MUCH DO YOU WISH TO SPEND FOR SALAR I ES? 80000
HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION" 110600

THE OBJECT OF THE GAME IS TO WIN AS MANY BATTLES AS POSSI8LE

11EN
MONEY
INFLATION

CONFEDERACY
65380

liEN
MONEY
INFLATION

UNION
18500

::::n0121

$

10

CONFEDERACY
36680
$ 148000
]5 Y.

UNION
62168
$

300000
o Y.

HOW liUCH DO I'OU WISH TO SPEND FOR FOOD? 40000
HOW MUCH DO YOU WISH TO SPEND FOR SALAR 1 ES? .:! 1211211210
Hm~ MUCH DO YOU WISH TO SPEND FOR AMMUN IT ION? 680«0

~;

Hm~ I1UCH DO YOU WISH TO SPEND FOR FOOD? 4000
HOW MUCH DO YOU WISH TO 5PEND FOR SALARIES? 4000
HOW MUCH DO YOU WISH TO SPEND FOR AMMUN IT ION? 73000

t'IORALE I S FA I R
BOTH SIDES ARE ON THE OFFENSIVE

MOlmLE I SPOOR
YOU ARE ON THE DEFENSIVE

'lOUR STEGY? 1

YOUR STEGY? 1

CHSUAL TIES

6767

4881

DESERTIONS

16

30

CONFEDERACY

CONFEDERACY

2399

CASUAL TIES
DESERTIONS

82

UNION
1887

'lOUR CASUALT I ES WERE 1 " MORE THAN
TilE ACTUAL CASUAL! TIES AT CHATTANOOGA

6

~'OUR CASUAL TIES WERE 22 ;; MORE THAN
THE ACTUAL CASUALlTIES AT· BULL RUN
~'OU

UNION

YOU LOSE CHATTANOOGA

LOSE BULL RUN
THIS IS THE BATTLE OF 'SPOTS'iLYANIA
tinY 5,1864
GRANT'S PLAN TO KEEP LEE ISOLATED BEGAN TO FAIL
HERE. AND CONTINUED AT COLD HARBOR AND PETERSBURG.

THIS IS THE BATTLE OF SHILOH
APRIL 6-7,1862
THE CONFECoERATE SURPRISE ATTACK AT SHILOH
FAILED DUE TO POOR ORGANIZATION.

MEN
ti0NEY
INFLATION

CONFEDERACY
38856
$

176000
27 ~

tiEN
li0NEY
WFLATION

UNION
46870

37

$

UNION
11181214561000

-2

:'I,

~

HOW MUCH DO YOU WISH TO SPEND FOR FOOD? 300,,0
HOW MUCH DO YOU WISH TO SPEND FOR SALARIES? 3:121121121121
HOW MUCH DO YOU WISH TO SPENC' FOR AMMUN I T ION? 1:.1.6121121121

OaTH SIDES ARE ON THE OFFENSIYE

1101~ALE

IS POOR
\'OU ARE ON THE OFFENSIVE

YOUR STEGY? :1

YOUR STEGY? :2

CI1SUAL TIES
DESERTIONS

CONFEDERAC'"
10107

CASURL TIES
DESERT IONS

29

~1.

HOW MUCH DO 't'ou WISH TO SPEND FOR FOOD? 7131211210
HOW MUCH DO 'iOU WISH TO SPEND FOR SALARIES? 70»00
HOW MUCH DO YOU WISH TO SPEND FOR AMMUN I T ION? 10lE'»»

2@650@
8

CONFEDERAC,'
61488
$ 241800

t~OI~ALE

UNION
11740

IS FAIR

CONFEDERAC'i
21929

UNION

123:65

15

]2

YOUR CASUALTIES WERE 24 Y. MORE THAN
THE ACTUAL CASUAL IT I ES AT SPOT5'iL YAN I A

17'

~jOU

LOSE SPOTSYLVANIA

YOU lHN SH1LOH
THI5 IS THE BATTLE OF ATLANTA
AUGUST, 1864
SHH:NAN AND THREE YETERAN ARMIES CONYERGE!) ON
HTLANTA AND DEALT THE DEATH BLOW TO THE CONFEDERAC,'.
THIS IS THE BATTLE OF SEVEN DAYS
JUNE 25-·JULY 1.1862
GENERAL LEE (CSA) UPHELD THE OFFENSIVE
THROUGHOUT THE BATTLE AND FORCE!) GEN. MCCLELLAN FlNC' THE UN I ON
FORCES AWAY FROM RICHMON~
UNION
118818

CONFEDERAC\'
MEN
MONEY
INFLATION

95079
$

427500
25 ~;

MEN
I'IONEY
INFLAT ION

CONFEDERAC,'
64198
• 247900
39 X

$

UNION
103651
520000
-4 7.

HOW MUCH DO YOU WISH ,TO SPEND FOR F(/I)D? 70000
HOI~ MUCH DO YOU WISH TO SPEND FOR SALARIES? 70000
HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION" 107000

:$ 5175121121

10 %

HOW MUCH DO 'iOU W'I SH TO SPEND FOR FOOD? 20000,
HOW MUCH DO YOU WISH TO SPENC' FOR SALARIES"' 6000
HOW MUCH DO YOU WISH TO SPENe' FOR AMMUNITION? 167500

li0RALE IS FAIR
YOU ARE ON THE DEFENSI YE
YOUR STEGY? 2

MORALE IS POOR
YOU ARE ON THE OFFENSIVE
CASUAL TIES
I)ESERTIONS

YOUR STEGY? 4

CASUALTIES
DESERTIONS

CONFEDERACY
40803
8$

UNION
6806

CONFEDERACY
BB5S
16

UNION

]019
]0

YOUR CASUAL TIES WERE 4 Y. MORE THAN
THE ACTUAL CASIJALITIES AT ATLANTA

5
YOU LOSE ATLANTA

YOUR CASUAL TIES WERE 98 Y. MORE THAN
THE ACTUAL CASUALITIES AT SEVEN DA\'S
YOU LOSE SEVEN DAYS

82

YOU HAVE WON 3 BATTLES AND LOST :l:l BATTLES.
THE UN I ON HAS WON THE WAR

CRAPS

GAME OF CRAPS (DICE)

Description
One of the more popular computer games, six versions of CRAPS
were submitted (although three appear to be virtually the same
program). The versio!,\ published here is based on standard
Nevada craps table rules. That is:
1.
2.
3.

A 7 or lIon the first roll wins
A 2, 3, or 12 on the first roll loses
Any other number rolled becomes your "point." You
continue to roll~ if you get your point, you win.
If you roll a7, you lose and the dice change hands
when this happens.
.

Your stake is set in Statement
an input statement if desired.

2l0~

this could be changed to

Source
An interesting version of CRAPS was submitted by Philip Bieluch
of Trinity College which uses a file to keep track of prior
winnings and/or losses. A short but complete version was submitted by George Gidzinski of Adlai Stevenson High School,
Prairie View, Illinois.
The published version has been circulating around DIGITAL and
its users for years. The original author is unknown.
Digital Equipment Corp.
Maynard, MA 01754

83

PROGRAM LISTING

SAMPLE RUN

80 RANDOMIZE
~0

FOR 1=1 TO 10\PRINT\NEXT I
PR I NT" TH I S DEMONSTRAT I ON SIMULATES A CRAP GAME WITH THE COMPUTER"
PR I NT" AS YOUR OPPONENT.
THE RULES ARE SIMPLE:'
PRINT
PR I NT"
*A 7 OR 11 ON THE FIRST ROLL WINS"
PRINT"
*A 2, J OR 12 ON THE FIRST ROLL LOSES"
PRINT
PR I NT" ANY OTHER NUMBER ROLLED BECOMES YOUR 'PO I NT' * YOU CONT I NUE"
PRINT"TO ROLL. .. IF YOU GET YOUR POINT, YOU WIN. IF YOU ROLL A 7,"
PRINT'YOU LOSE. THE DICE CHANGE HANDS WHEN THIS HAPPENS. "
PRINT "JUST BET $0 TO DUIT.
PRINT
200 PR INT

100
110
120
130
140
150
160
170
190
185
190

210 LET Z=5*INT(10+11*RNc.<0»
215 PR I NT "ARE YOU READY"; \ INPUT B$
216 IF Bf=" YES" THEN 220\ I F B$=' NO' THEN PR I NT 'I'LL REPEAT MI'SELF THEN
217
228
238
240
258
260
270
2S8
290

300

318
320

330
340
359
360

370

380
390

400

419
420

430
440
450

460

=:l~~

'SPLEN~I~..

. YOU ARE GIVEN ',Z, "DOLLARS TO PLA~ WITH.'

600

oA 7 OR 11 ON THE FIRST ROLL WINS
*A 2, 3 OR 12 ON THE FIRST ROLL LOSES
AN~

OTHER NUMBER ROLLED BECOMES YOUR 'PO I NT' * YOU CO NT I NUE
TO ROLL. .. IF YOU GET YOUR POINT, YOU WIN. IF YOU ROLL A 7,
YOU LOSE. THE DICE CHANGE HANDS WHEN THIS HAPPENS.
JUST BET $0 TO DUIT.

ARE YOU READY? YES
SPLENDID ..... YOU ARE GIVEN

YOU ROLL FI RST.

YOU ROLL

YOU ROLL
~OU ROLL
YOU ROLL
YOU ROLL

';1)2;

'FIND

',;1)2;

';1)1;

YOU ROLL
YOU ROLL
~OU ROLL

830
840

850
860

870
880

990
900

919
920
930
940

950
960

970
980
990
1000

1910
1020

1030
1040

1050
1060
1070

ieee

1090
1109

1110

1129
1130

SO YOUR POINT IS 10
· .. ROLL AGA I N.
· .. ROLL AGA I N.
AND MAKE YOUR PO I NT

3 AND
4 AND

2 AND
1 AND
4 AND

2 SO YOUR POINT IS 4
5 ... ROLL AGAIN'.
3 AND LOSE ...

HOW MUCH DO YOU BET? 10
SO MY POINT IS 8
· .. ROLL AGA IN.
· .. ROLL AGA I N.
AND MAKE MY PO I NT

AND

4 AND
2 AND
4 AND

~OU NOW HAYE
95 DOLLARS
HOW MUCH DO YOU BET? 10

ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL

IF (5-2)0(5-3)0(5-12)=0 THEN 640
IF (5-7)'(5-11>=0 THEN 710
IF W)0 THEN 619
PRINT "SO MY POINT IS'; S
OOTO 620

6 AND
4 AND
5 AND
5 AND
1 AND
4 AND
2 AND

2 SO MY POI.NT IS
2 · .. ROLL AGA I N.

e

5 · .. ROLL AGA I N.
1
ROLL AGAIN.
1 · .. ROLL AGA IN.
6
· . ROLL AGA I N.
6 AND MAKE MY POINT

YOU NOW HAVE
85 DOLLARS
HO~ MUCH DO YOU BET? 10
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL
ROLL

760 LEI Z=Z-tB
770 PRINT

810
820

5 AND

3 AND

YOU NOW HAVE
105 DOLLARS
CHANGE DICE NOW ..

640 PR I NT "AND CRAP O.lJT.
650 LET C=1
660 IF W)0 THEN 690
670 I..E'f Z=Z+8
680 GO TO 770
690 LET Z=Z-B
730 GOTO 770
710 PR I NT "AND PASS ..
720 LET C=1
730 IF W)0 THEN 769
740 LET Z=Z-B
750 GOTO 779

790
800

6 AND PASS.

YOU NOW HAVE
115 DOLLARS
HOW. MUCH DO YOU BET? 10

ROLL
ROLL
ROLL
ROLL

".. !)1;'AND

1 AND

YOU NOW HAVE
195 DOLLARS
HOW MUCH DO YOU BET? 10

610 PRINT MSO VOUR POINT IS P ;$
620 LET p=s
630 GO TO 479

780

95 DOLLARS TO PLAY WITH.

HOW MUCH DO YO~ BET? 10

PRI NT
IF N-2.INT(N/2)=9 THEN 310
LET W=-1
PRINT 'I'LL ROLL FIRST . . . . .
PRINT
PRINT
60TO 359
LET W=1
PRINT "YOU ROLL FIRST ....
PR INT
PR INT
LET G!=0
PRINT "HOW MUCH DO YOU BET"
INPUT B
PR INT
IF B=INT(B) THEN 410
PRINT
PRINT "NO COINS PERMITTED ... JUST BILLS, PLEASE.'
GOTO 360
IF B=0 THEN 1090
IF BU+1 THEN 479
~~i~T 3~~ON' T, TRY TO BET MORE THAN YOU HAY£, PLEASE.'

520 PRINT"
lROLL
5 30 GOTO 550
540 PRINT II\(OU ROLL
550 IF Q01 THEN 860
570
580
590

WfTH THE COMPUTER

GO TD 90

470 LET D1=INT(60RND(0)+1)
480 LET D2=INT<6*RND(0)+1)
490 LET Q=Q'1
500 LET S=DHD2
510 IF W)0 THEN 540

560

~~1~0~~Mg~~6~~~~ON ~~~U~~m =R~R~iM~~~E

IF Z{1 THEN 1060
PRINT "YOU NOW HAVE ", Z; 'DOLLARS"
IF 09 THEN 830
PRINT "CHANGE DICE NOW.
PRINT
LET w=w*c
LET Q=0
GOTO 360
IF S07 THEN 940
PRINT "AND LOSE.
LET C=-1
IF W)0 THEN 920
LET Z=Z'B
GO TO 770
LET 2=-Z-B
GOTO 770
IF S=P THEN 970
PRINT " ... ROLL AGAIN.
GO TO 470
IF W)0 THEN 1020
PRINT "AND MAKE MI' POINT'
LET C=1
LET Z=Z-B
GO TO 770
PRINT 'AND MAKE YOUR POINT'
LET C=1
LET Z=Z'S
GO TO 779
PRINT
PRINT "YOU HAYE RUN OUT OF MONEy .... SORRY ABOUT THAT.
GOTO 1110
PRINT "THANKS FOR THE GAME.
AND CONGRATULATIONS'
PRINT "FOR BEING ABLE TO ~UIT WHILE YOLI WERE AHEAD. '
PR I NT\PR I NT\PR I NT
CHA I N$ "DEMOES"
END

2 AND
4 AND

2 AND
1 AND

4 AND
4 AND
4 AND

6 AND
4 AND
6 AND

2 AND
2 AND
6 AND
1 AND

2 SO MY POINT IS
1 · .. ROLL ABA I N.
1
· . ROLL AGA I N.
ROLL AGA IN.
2 : : . ROLL AGAIN.
5
. ROL'L ABA I N.
6 · .. ROLL AGAIN.
2
ROLL AGAIN.
4 · .. ROLL ABA I N.
2 · .. ROLL AGA I N.
4 · .. ROLL AGA I N.
3
. ROLL AGA I N.
6 · 'ROLL AGAIN.
6 AND LOSE.

5

YOU NOW HAVE
95 DOLLARS
CHANGE DICE NOW.
HOW MUCH 00 YOU BET? 19
YDU ROLL

5 AND

6 AND PASS.

~OU

NOW HAVE
195 DOLLARS
HOW MUCH DO YOU BET? 19
YOU
YOU
VOU
YOU
YOU
YOU

ROLL
ROLL
ROLL
ROLL
ROLL
ROLL

3 AND
2 AND
2 AND
2 AND
5 AND
2 AND

6 SO YOUR POINT IS 9
3 · .. ROLL AGA I N.
2 · .. ROLL ABA I N.
2 · . ROLL AGA I N.
1
ROLL AGA IN.
5 AND LOSE.

YOU NOW HAYE
95 DOLLARS
CHANGE DICE NOW.
HOW' MUCH DO YOU B~T? 0
THANKS FOR THE GAME.
'AND CONGRATULATIONS
FOR BEING ABLE TO QUIT WHILE YOU WERE AHEAD.

84

CUBE

TRAVEL ACROSS A 3-D CUBE

Description
CUBE is a game played on cube with a side dimension of 2. A
location is designated by three nuffibers--e.g., 1, 2, 1. The
object is to travel from 1, 1, 1 to 3, 3, 3 by moving one
horizontal or vertical (not diagonal) square at a time without
striking one of 5 randomly placed landmines. You are staked
to $500; prior to each play of the game you may make a wager
whether you will reach your destination. You lose if you hit
a mine or try to make an illegal move--i. e., change more than
one digit from your previous position.
Program Author
Jerimac Ratliff
5462 Woodway Drive
Fort Worth, TX 76133

1,1, ,

',I, ,
85

PROGRAM LISTING
100
I U
120
130
140
150
160
170
IBe
190
_00
210
220
230
240
'S"
26B
270
280
29.
300
310
320
330
340
350
360
370
lli~

PRINT"DO VOU W~NT TO
SEE THE INSTRUeTIONS; CVES"I,NO"·0)W
INPUT 67
IF 67.0 THEN 370
PRINT"THISIS A GAME IN WHICH VOU WILL BE PlAYING AGAINST THE"
-PRfN'T"RANDUM D-Etfs~tO~N ~~OF-~-THE COMPUTER, THE FIELD OF P~i.AV Ts~ ~-"
PRINT'CUBE OF SIDE 3, ANV OF THE 27 LOCATIONS CAN BE DESIGNATED"
PRINT"BV INPUTING THREE NUMBERS SUCH AS 2,3,1,
AT THE START,PRINT"VOU ARE AUTOMATICALLV AT LOCATION I,! .I,
THE OBJECT OF«
PRINT"THE GAME IS TO GET TO LOCATION 3,3,3,
ONE MINOR DETAIL,"
PRINT"THE COMPUTER .ILL PICK,AT R~NDUM,5 LOCATIONS AT .HICH"
PRINT"IT .IbL PL~NT LANO MINES,
IF VOU HIT ONE OF
rHESE LOC~TlONS,"
PRINT"VOU LOSE,
ONE OTHER DETAIL, VOU MAV MOVE ONLV ONE SPACE'
PRINT"IN ONE DIRECTION EACH MOVE,
FOR
EXAMPLE, FROM 1,1,2 YOU"
PRINT'HAV
MOVE TO 201,2 OR 101,3,
VOU MAV NOT CHANGE"
PRINT"T.O OF THE NUMBERS ON THE S~ME HOVE,
IF VOU MAKE
AN II.LEGAL"
PRINT"MOVE, VOU LOSE AND THE COMPUTER TAKES THE MONEY VOU HAY"
PRINT'HAVE BET ON THAT ROUND,"
PRINT
PRINT
PRINT'ALL VES OR NO QUESTIONS WILL BE ANSWERED
A ! FOR YES"
PRINT"OR I 0 (ZERO) FOR NO,"
PRINT
PRINT".HEN STATING THE AMOUNT Of I wAGER, PRINT ONLV THE NUMBER"
PRINT"OF DOLLARS (EXAMPI.E, 25o,
VOU ARI:' AUTOMATICALLV STARTEO .ITH A'
"RINT"!00
DOLLAR ACCOUN',"
PRINT
PRINT"GOOD LUCK"
LET A105~0
LET AoINTC3'CRND(X)))
IF 1<>. THEN 410
LET A.3
LETSoINTC3'(RND(X)))
IF8<>0THEN440
LET B02
LETC01"TC3'CRNOCX)))
IFC<>0THfN470
!.ETC.3
LETo.!NTC3'CRNDCX)))
IfD<>0THEN500
LETOol
LETEoINTCJ'CRNOCX)))

a.

390
400
410
420
430
440
460
460
470
480
490
500
510 IFE<>~THEN530
520 LErE.)
530LEHoINTC3'CRNDCX)))
540 IFF<'0THEN550
550 UTFo3
S60 LETGoINTC3'CRNDCX)))
570 IFr,<>0THEN590
580 LETG03
590 LETH'INTC3'CRNDCX)))
600 IFHc>0THEN620
610 LETHo3
620 LETloINTC3'CRNOCX)))
630 IFI<>~THEN650
640 LET! 02
650 L~TJoINTC3'CRNDCX)))
660 IfJ<>0THEN660
670 LETJ.3
'680 LETK-INTC30CRNDCX)))
690 IFK<'0THEN710
700 LEn02
710 LETLoINT(3'CRNDCX)))
720 IFL<>0THEN740
730 LETL-3
740 LETM'INTC3'CRND(X)))
750 IFM<>0THEN770
760 LET.o3
770 LETNoINTC3*CRNOCX)l)
780 IFN<>0THEN800
790 LET Nol
B00 LET OoINT C3*CRNDCX)))
810 IF 0 <>0 THEN 830
820 LET 003
830 PRINT "WANT TO MAKE A WAGf:.~l"
840 INPUT Z
850 IF zoe THEN 920
860 PRINT "HOW MUC,",?"
870 INPUT ZI
876 IF AIW+I THENI03~
951'1

("gil
1100
1110
1120
1130
1140

fill)!
1160
1170
1180
1100
1200
T210
1220
1230
1240
\250
1260
1270

p~FfINt

1460 LET Z2 0 AI-ZI
1470 IF Z2>0 THEN 1500

1480 PRINT "YOU BUST"
1490 GO TO 1610
1500 PRINT" VOU NOW HAvE"J Z2J "DOLLARS"
LET AloZ2
1520 GO TO 1580
1522 PRINT"TRIED TO FOOL MEl BET AG4IN"J
1525 GD TO B70
1530 PRINT"CONGR4TUL.ATlONS"
\640 IF Z00 THEN
1580
f!i50
LET Z20AI.ZI
1560 PRINT "VOU NOW HAVE'"
Z21"DOLLARS"
1570 LET AloZ2
1580 PRINT"DO vou WANT TO TRV AGAIN?"
1590 INPUT S
1600 IF Sol THEN
380
r6r0-PR~INT j'TOUGH LUCK"
1620 PRINT

\llnr

1630 PRINT

II

GOODBYE"

1640 END

DO 'l'OU ~~ANT TO

CUBE OF S I DE 5.

SEE THE I N5TIX+\ THENI030
IF QOCX+I) THEN 1010
9B0 IF R >(V+I)
THEN 1030
990 GO TO 1050
1000 IF Q . . X.I THEN 1030
1010 IF R,oV+1 THEN 103.
\020 GO TO 1050
1040
1050
1060
1070
10B0

1340
1350
1360
1370
1380
1390
1400
1410
\420
1430
1440

poJ THEN 1300
TO 1330
GoK THENI320
TO 1330
RoL THEN 1440
Ir P.~M THEN 1350
GO To 1380
IF QoN THEN 1370
GO TO 1380
IF RoO THENI400
PRINT 'NEXT MOVE"
GO TO 930
PRINTu ........ BANG •••••• 1I
PRINT "VOU LOSE"
PRINT
PRINT
I"
Z00 THEN 1580

13:10

IF
GO
IF
GO
IF

SAMPLE RUN

?l70~

1030 PRINT

1280
1290
1300
1310
1320

IL.LEGAL MOVE", "YOU LOSE-lI

GO TO 1440
LET .0P
LET xoQ
LET voR
IF p03 THEN 1100
GO Tn 1130
IF
Q03 THEN 1120
GO TO 1130
IF R03 THEN 1530
I f PoA THEN 1150
GO TO 1180
IF QoB THEN 1170
GO TO 116~
IF RoC THENI400
I f pon THEN 1200
GO TO 1230
IF QoE THEN 1220
GO TO 1230
IF
RoF THeN 1400
IF PoG THENI250
GO TO 1280
IF GoH THENI270
GO TO 12B0
IF Ro!THEN 1400

ITS 'T'OUR MOYE
? L 2 .. 1
NE:n t10VE
? 2,2.,1
NE~n MOVE
NEXT MOVE
? }, 2J :2
NE~"n MOVE

? ]:.2\2'. . :L
CONGRATULAT IONS
YOU NOW
HAVE 6130 DOLLARS
[)I) '-r'OU WANT TO T~:'l' rIGA I N?
? 1
l~ANT TO />lAKE A WAGER?
'? 1

86

DIAMND

PRINTS DIAMOND PATTERN

Description
This program fills an 8~11 piece of paper with diamonds (plotted
on a hard-copy terminal, of course). The program asks for an
odd number to be input in the range 5 to 31. The diamonds printed
will be this number of characters high and wide. The number of
diamonds across the page will vary from 12 for 5-character wide
diamonds to 1 for a diamond 3l~characters wide.
Proqram Author
Digital Equipment Corp.
Maynard, MA 01754

87

PROGRAM LISTING

SAMP.LE RUN

3 PRINT "FOR A PRETTY DIAMOND PATTERN, "

FOR A PRETTY DIAMOND PATTERN,
TYPE I N AN ODD NUMBER BETWEEN 5 AND H,
? 15

4 PRINT "TYPE IN AN ODD NUMBER BETWEEN 5 AND 21, "
5 I r.PUT R\PR I NT
6 Q=INr<60/R)

S FOR L=1 TO

D
DEC
DEC!
DEC! !
DEC! ! !
DEC! ! !
DEC' ! ! ! !
DEC!! ! ! ! !
DEC! !
DEC' !
DEC!
DEC!
DEC!
DEC
D
D
'DEC
DEC!
DEC! ~
DEC' !
DEC! ' "
DEC! ! ! ! !
DEC! I 1 1 I !
DEC! !!! !
DEC!
"
CtEC! ! ,
DEC'
DEC!
DEC
D
D
DEC
DEC!
DeEC! !
DEC! "
DEC! ! ! !
DEC! ! ! !
DEC! ! ! ! ! !
DEC! ! " !
,
DEC'
DEC! !
DEC!
DEC!
DEC
D

Q

10 X=1 W=R\Z=2
20 FOR N=X TO Y STEP Z
25 PRINT TAS«R-Nli2l;
28 FOR M=1 TO Q
29 C=1
:10 FOR R=1 TO N
31 IF C=1 THEN 40
]2 IF C=2 THEN 42
33 IF C=] THEN 44
J5 PRINT "''',\GOTO 50
40 PRINT "D", \GOTD 47
42 PRINT "E", \GOTO 47
44 PRINT "C";
4;:' C=C+1
50 NEXT A'
5] IF M=Q THEN 60
55 pRINT TASCR*M+CR-NI/2);
56 NEXT M
60 PRINT
70 NEXT N
8] IF X01 THEN 95
85 X=R-2W=1 \2=-2
90 GOTO 20
95 NEXT L
99 END

,

!
!
!
!
!
!

,,,
, , ,
,, ,
, ,

!
!
!
!
!
!
!

! !

, !1··!!
,
, ,!

,

,
,
,

D
DE
DEC
DEC!
DEC!
DEC!
DEC! ! "
DEC! "
DEC! ! ! !
DEC! "
DEC! !
DEC!
DEC
DE
D

,

,,

,,

RERDY

88

D
DEC
DEC!

DEC! !
DEC! ! !
DEC! ! !
DEC! ! ! !
! [:tEe! ! ! ! ! !
DEC!! !
DEC!! ! !
()EC! !
DEC! !

,
,

,,
,

DEC!
DEC! !
t'EC! ! !
DEC! ! ! !
!DEC! ! ! ! !
DEC! ! "

DoEC!

!
!
!
!
!

,
,

"

CIEe! ! !

DEC! !

DEC!

DEC!

DEC
D
D
DEC

DEC
D
D
DEC
DEC!
DEC! !

DEC!

, ,! !
",
!

READY

D
DEC
DEC!

DEC! !
DEC!

PE'C!

,"
," !

DEC! ! !
!DEC!
!

"
DEC! !

"

,'"

DEC! , !
,
DEC! !
DEC! !

DEC!

"
DEC! ! ! !
DEC! !
!
"
!DEC! ! " ! !

,,
, !" !

DEC!
DEC!

DEC! "

DEC!
DEC
D
D
DEC
DEC!
DEC! !
DEC! "
DEC!!! !
DEC! ! ),!
!DEC!
"
DEC!
!
"
DEC!! !

DEC!
DEC
D
D
DEC

DEC!

, ,,

,

,

,
DEC!

DEC!
DEC! !
DEC! ! !
DEC! ! !
DEC!
! !
"
!DEC!
! !
DEC!! !
DEC! !
DEC!
"
DEC! !
DEC!
DEC
D

,

'" , ,
,,

,
,, ,
,

DEC! ~

'"
,,,,
,,,
DEC!

DEC!

DEC!

"

DEC! !
1>e:C!
DEC
D
D
DEC
DEC!
DEC! !
DEC! !
DEC! " !
DEC! ! ! "
,
!DEC! ! ! ! !
,! !
~'EC !
DEC! !

,

,

," ,
,

DEC!

DEC! !

DEC!
DEC
D
D
DEC
DEC!
D.EC! !
DEC! ! !
DEC ,I!
DEC! !
!DEC! ! !
DEC! " !
DEC! ! ! !
DEC! !

,,
,,,

D
DEC
DEC!
DEC! !
CrEC!! !
DEC! ! "
DEC! !
! DEC! ! ! !
"

,

,
~EC!

DEC
D
D
DEC
DEC!
CoEC! !
DEC! ! !
DEC! !

,,
,,
DEC!
"
!DEC! !
,!
DEC!!! !
11.1

,

DEC!! !
DEC!
"
DEC! !
DEC!
DEC
D

DEC!
DEC!
DEC
D
D
DEC
DEC!
DEC! !
DEC!
~EC! !
DEC! !
"
!DEC! " ! ! !
DEC! !
!
"
DEC! "
DEC! "
DEC! !
DEC·!
DEC
D
D
DEC

,,

,

,,

,

DEC!

,
,

DEC!
DEC! "
DEC! ! !
DEC!
! !
!DEC! ! !
" !
DEC! ! ~ ! !
DEC! "
DEC! "
DEC·!
DEC!

,,
,

,

~'EC

D

DICE

SIMU~TES

ROLLING TWO DICE

Description
Not exactly a game, this program simulates rolling a pair of
dice a large number of times and prints out the frequency distribution. You simply input the number of rolls.
It is interesting to see how many rolls are necessary to approach the
theoretical distribution:
1/36
2/36
3/36

2
3
4

2.7777 ••• %
5.55~5 ••• %
8.3333 ••• %

etc •
. Program Author
The author of this program is in the seventh grade at Harrison
Junior-Senior High School.
Daniel Freidus
Park Drive South
Rye, :t-T'l' 10580

PROGRAM LISTING
11:1 DIM F

SAMPLE RUN

(12)

THIS PROGRAM SIMULATES THE ROLLIN(j OF A

20 REM Dt=lNN'r' FRE 1 DUS

3121 PR 1 NT
40 PRINT
~Hl PRINT
60 PRINJ

"TH I S PROGRAM ~; I MULATES THE ROLL I Nf3 OF A II
"PAIR OF DICE.
"'1'01) ENTER THE NUMBER OF TIMES 'f'OU ~JANT THE COMPUTEF:"
"TO /ROLL~ THE [)ICE.
WATCH OUT, 'v'EI':'T' LARGE NUMBERS TAKE"

?0 PRINT "8 LONG TH1E ..

IN PAf':TICULAF:.,

NUMBERS OVEi': 5@0121.

PAIR OF DICE.
YOU ENTER THE NUMBEf;: OF T I ME::' 't'OU WANT THE COMPUTER
TO "ROLV THE DICE.
WATCH OUT., 'v'Ef;:'T' LAF:I3E NUMBERS TAKE
A LONG TIME, IN PAfnICULAf;:, NUME:ERS OVEP 50~O.

II

813 FOR Q=l TO 12
~Hl' F(Q)=0

HOl4 MANY ROLLS? 50(11)

llh) NEXT Q

TOTAL SPOTS
2

:1:113 PRINT\PRINT "HOW MAWr' ROLLS".:
:1.':2121 1 NPUT X

410

130 FOR 5.=1 TO X

539

140 A=JNT(6*RND+l)
15(1 B= I NT (6*RND+l
160 R=A+8

NUMBER OF TIMES
140
285

<'92

~

1?~3

F{R)=FOn+l

8

691

:1813

NE~-'::T

9
10
11

552
428

S

185 PRINT
~l90 PRINT "TOTAL SPOTS",. "NUr18Ef': OF TIMES"

12

2~W

FOR V=2 TO 12
210 PRINT V"" F(V)

TRY AGAIN? 'l'ES

226 NEXT II

222 PRINT\PRINT "Tf;:'r' FH:;AIN".t
2:D I NPI)T :U:
224 IF Z$=""'E:::" THEN 8121
~240

288
1s9

TOTAL SPOTS
2

END

f~EAD'.f

NUMBER OF TIMES
27]:
557

846
1121
1]:8]

8
9
10
11

12

1670
1:<98
110>
821
547
281

TRY fWAIN? '1'ES

10TAL SPOTS

NUMBER OF T I
5

ME~;

10
10

22
8
9

9

10
11

12
"fR'T' AGAIN? 'T'ES
HOW MANY ROLLS? 1000

TOTAL SPOTS
2
3
4
5

8
9

:to
11
12
TR',' AGAIN? NO

90

NUMBER OF T I ME::'

>5
51

78
112
130
168
lJ:9
115
:35
60

27

DIGITS

COMPUTER TRIES TO OUTGUESS PLAYER

Description
The player writes down a set of 30 numbers (0, 1, or 2) at random
prior to playing the game. The computer program, using pattern
recognition techniques, attempts to guess the next number in
the input.
The computer asks for 10 numbers at a time.
It always guesses
first and then examines the next number to see if it guessed
correctly. By pure luck (or chance or probability), the computer ought to be right 10 times.
It is uncanny how much better
it generally does than that!
Source
Keiwit Computation Center
Dartmouth College
Hanover, NH 03755

91

SAMPLE RUN

PROGRAM LISTING
2U
220
230
240
250,
260
270
280
290
300
310
320
330
340
360
370
380
400
420
440
450
480
510
520
530
540
550
560
570
580

5ge
600
620
630
660
670
69~

PRINT "THIS IS A GAME OF GUESSING,"
PRINT "FOR INSTRUCTIONS, TYPE '1', ELSE TYPE
INPUT E
IF E00 T~EN 360
PRINT
PRINT "PLEASE TAKE A PIECE OF P4PER AND WRITE DOWN"
PRINT "THE DIGITS '0'.,
OR '2' THIRTY TI~ES AT RANDOM,"
PRINT "ARRANGE THE" IN THREE LINES OF TEN DIGITS,"
PRINT "I WILL ASK FOR THEM 10 AT A TIME,"
PRINT "I WILL ALWAVS GUESS FIRST, AND THEN LOOK AT YOUR"
PRINT "NEXT NUM8ER TO SEE IF I WAS RIGHT,
BY PURE LUCK I"
PRINT "PUGHT TO 8E RIGHT 1m Tl~ES,
BUT I HOPE TO DO BETTER"
PRINT "THAN THAT •••••
PRINT\PRINT
READ A,e,c
DATA 001,3
DIM MC26,2), KC2,2), LCe,2)
MAT MoCO"\M4T KoCON
MAT KO(9).K\MAT LoCON
MAT Lo(3).L
LC0,0)02\LC4,1l02\LC8,2)02
z026\ZI08\Z202

'0'"

'I',

THIS IS A GAME OF GUESSINa
FOR INSTRUCTIONS, TYP.E '1',

ARRANGE THEl'I IN'THREE LINES OF TEN 'P[GITS·.
I W[LL ASK FOR THEM 1,0 in A. TIME,
.
[ W[LL ALWAVS GUESS FIRST, AND THEN ,LOO~', AT YOUR
tlEXT NUMBER, TO SEE IF I WAS R [GHT.
BI' PURE LUCK' I
OUGHT TO BE RIGHT 10 TIMES.
BL'T I HOPE TO DO BETTER
l'HAN THAT **"'*

TEN NUMBERS PLEASE? 1,0,2,0,2,1,1,1,2,
NY GUESS,

70P SloA.~CZ2,J)+~.L(ZI,J)+C.MCZ,J)
710 IF S>81 T~E~ 760
720 IF SCSI THEN 74~
730 IF RNOc, 5 THEN 760
74A SoSI\GoJ
760 NEXT J
770 PRINT G,'CU),
780 IF GONCU) THEN 810
790 PRINT "WRONG", X
800 GOTO a80
~\0 XoX+1
820 PRINT "RIGHT",X
8J0 114CZ,N).htZ,N)+l
840 LCZI,NloLCZI,N)+1
850 KCZ2,N)OKCZ2,Nl+1
860 ZoZ-INTell9).g
870 Z03.Z+NrU)
880 ZloZ-l NT CZl9).9
890 Z20NCll)
900 NEXT
910 NEXT T
920 PRINT
9J0 IF X>10 T~EN 9'80
940 IF XCI0 THEN IAIA
950 PRINT "I GUESSED EXACTLY 1/3 OF VOUR NUMBERS,"
960 PRINT "IT IS A TIE GAME,"
970 GOTO \03~
980 PAINT "I GUESSED MORE THAN 1/3 OF VOUR NUMBERS,"
990 PRINT" I .1", "\FOR gOI TO U\PRINT CMoS(?) "NEXT Q
1000 GOTO \030
1010 PRINT "I GUESSED LESS THAN 113 OF VOUR NUM8ERS,"

2

1
2
2

1

2
2

°

RESULT

NO.

RIGHT

NO.

RIGHT

RIGHT
WRONG
WRONG
WRONG
~'IGHT

R[GHT

WRONG

2

2

WRONG
RIGHT

1

0

WRONG

'fEN IIUMBERS PLEASE? 0,1,2,0, l., 2, 0, 1, 2, 0
NY GUESS

1
:I.

YOUR NO.

2

1
1

°1

2

2

e

1

TEN NUMBERS PLEASE?
NY GUESS

1
2
2
2
2
2
2

1
1

2
2

1~ :1~

2

:I.

4
5
6
6

7
8
8
9

l0
10

WRONI3

VOUR NO.

1
1
1
1
1
1
2

RESUL T
WRONG
R[GHT
R[GHT
WRONG
RIGHT
R[GHT
WRONG
RIGHT
RIGHT

1
2
0
:I.
2

2

1
1

,I

1020 PRINT "'rOll BEAl,ME.

YOUR NO.

1
0
2
0
2
1
1
1

1

xoa

FOR h i TO 3
PRINT
PRINT "TEN NUM8~RS PLEASE",
INPUT NO) ,N(2) ,N(3) ,N(4) ,N(5) ,N(6) ,N(7) ,NCSl,NC9l,NC\0l
~OR 101 TO 10
.0NCIl-1
IF .0SGNC") THEN 620
,PRINT hUSE ONLY THE DIGITS 'Gil, '1', o~ '2',,"
PRINT "LET'S TRY AGAIN,"\GOTO 530
"EXT I
PRINT\PRINT "MV GUESS·, "VOUR NO,", "RESULT','NO, RIGHT"\PRINT
FO~ Uol TO 10
NoN (U)\So0
FOR J'0 TO 2

ELSE TYPE' 0'? 1

PLEAS~, TAKE A pi,ECE OF PAPER AND WRITE MWN
THE DIGITS '0', :'1', 'OR '2' THIRTY' TIMES AT RANDOM.

i. 1, i. L 2;. 2. 2. 2.
RESIJL T

NO.

RIGHT
WRONG
WRONG
WRONG
WRONG
WRONG
R[GHT
WRONG
WRONG
WRONG

R[GHT

11
11
11
11
11

1l
12
12
12
12

GUESSED MORE THAN 113 OF YOUR NUMBERS.
WIN.

I
I

DO YOU WANT TO TRY AGA I N (1 FOR YES,

°

FOR NO)? 1

TEN NUMBERS PLEASE? 1,1,1,1,1,1,2,2,2,2
NV GUESS

CONGRATULATIONS •• *.n

2

\030 PRINT
1040 PRINT "DO VOU WANT TO TRY AGHN (I FOR VES, 0 FOR NOl"'
Ue0 INPUT X
1070 IF xol THEN 400
1080 PRINT\PRINT "THANKS FOR THE GAME,'
\a90 END

YOUR NO.

1

:I.

1

1

:I.

2
2
2
2
2
:I.
:I.

1
1
:I.

2
2
2

2

RESULT

NO.

R[GHT

NO.

RIGHT

R[GHT
WRONG
RIGHT
WRONG
WRONG
WRONG
RIGHT
RIG.HT
WRONG
WRONG

TEN NUMBERS PLEASE? 0, 0. 0, 0, 0, 0, 2,2,2,2
N~

GUESS

:I.
1
1
1
1
:I.

:I.
1
1
1

YOUR NO.

o
o
o
9

o
o
2
2
2
2

RESUL T

4
4
4

WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG

4

4
4

4
4
4
4

TEN NUMBERS PLEASE? 0,2,O,2,O,20,O,2,O

? 2
USE ONLY THE DIGITS . . 8 ... ~

... :1. ... ~

OR .. 2 ....

LET'S TRY AGAIN.
TEN NUMBERS PLEASE? O,2,O,2,O,2,O,2,O,2
IW GUESS

:I.
:I.
:I.
:I.
1
1
1
:1
:I.
:I.

YOUR NO.

o
2
o
2
o
2

o
2

o
2

RESUL T

NO.

R[GHT

4
4
4
4
4
4

WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG
WRONG

4

4·
4
4

I GUESSED LESS THAN in OF YOUR NUMBERS.
YOU BEAT ME.
CONGRATULATtONS ••••
00 YOU WANT TO TRY AGAIN (1 FOR YES,

92

THANKS FOR THE GRME.

0 FOR NO)? 0

DOGS

DOG RACE

Description
This is a dog race game similar to those found in
and amusement parks. The prior racing experience
(wins and losses) has a bearing on the outcome of
After this is posted, up to 19 players may bet on
Maximum bet is $500.00 and minimum is $2.00.

penny arcades
of each dog
the race.
a dog.

After all the bets are in, the odds will be posted and the race
begins! After each days's racing, the track will close and
record the performance of all the dogs in a permanent file
which is called the next time the program is run.
Computer Limitations
DOGS was written for a DIGITAL EduSystem 50 (Timeshared-8);
consequently, the file handling routine (Lines 25, 30, 35, 55,
975, 985, 1085) may have to be changed for other systems.
Program Author
The author remarks that he is now 15 and started using a PDP-8
at the age of 12. Since then he has compiled 4 notebooks of
programs in BASIC, FOCAL, FORTRAN, and ALGOL. Of his 23 BASIC
games, 5 are published in this book.
Victor Nahigian
39 Beaver Road
Weston, MA 02193

93

PROGRAM LISTING
555
560
565
570
575
580
585
590
595
500
605
610
515
520

5 REM
10
15
20
25
30

V,NAHIGlAN
8TH GRADE
DOG RACE GAME
DIM S(10l.C(10),J(20".(l0),AC10)
DIM N$(2~),H$(10),P(2.)
DIM Y(10),B(lI),M5(20)
RECO~D V
RECO~D X

J~

OPEN

40
45
50
55
50
65
70

IF 8906 THEN 70\FOR 1 0 1 TO 10\GET 8,25,I\V9 o V9+V\"EXT
IF V9<25 THEN 60\IF V9.200 THEN
55
GOTO 100
UNSAVE 8\UNSAVt. 9
PRINT "PI.EASE wAlT, DISREGARD THE 25 BEl.l.a"
PRINT\PRINT\PRINT\PRINTWRINT\Sg06\GOTO
35
FOR 1 0 1 TO 25-V9\RANOOMIZE\.oINTC10+RNO(X,,+I\GET 8,25,H

8,"~INS"'OPEN

9,uLOSSES"

8,25,~\FOR

15 V-V+l\PUT

Tel TO

l~'IF

HeT THeN

625 IF

85

80 GET 9,30,T\XaX.l\PUT 9,30,T

530
635
640
645
650
655

85 NEXT T
90 PRINT Cl;Ay THAT THE 0005 ON THAT DOG ARE GOOD"

~(1)<>0

PRINT TAB (2) 1 "XXXXXXXFINISHXXXXXXXX"
GOTO
511
FOR y02 TO 22
PRINT TAB(YlI"X"IUB(Y)ICHR$(135l/
IF Y07 THEN
685
NEXT Y
GOTD
681
PRINT " F.INISH",
.,.-13
GOTO
655
PRINT
PRINT II
FOR 1-2 TU 22\PRINT "<""NEXT I\PRtNT
IF 0<01 THcN
735
GO'(1)
FOR 12=1 TO 0
If S(wrI2))13 THEN
360
355 HI3)oAClJ).P(1l
360 NEXT 13
365 NEXT I
370 fOR 101 TO 10
375 IF A(I»'2 THt.N 390
380 BCl).jNTlbllll
I PICK UP 3 MARBLES,
TOTAL • 7
AND WHAT IS YOUR NEXT MOYE.

TOTAL·

=

AND WHAT IS YOUR ,NEXT MOYE.

n'

MY TOTAL IS

15

MY TOTAL IS

16

TOTAL' 2
YOUR TOTAL IS 10
I PICK UP 1 MARBLE~
TOTAL
1

=

AND WHAT IS YOUR NEXT MOYE;

810 PRINT"'t

11

GOTO 880
REM tHIs IS WHERE r WIN
PRINT "I PICK UP"'M'" MARBUS,"
PRINT""

THAT 15 ALL OF THE MARBLE$,
MY TOTAL 15 16

YOUR TOTAL IS 11

I WON,
DO YOU "'FlNT TO PLAY
AGAIN? TYPE 1 FOR YES AND 0 FOR NO,

or

A811 PRI~T " THAT IS AuL
TH~ ~ARBLr.S,"
890 PRINT""
900 PRINT'
MY TOTAL IS",MI,YOUR TOTAL lS"'~1
910 PRINT'"
920 If INTeMI/2)-MI/2 TKE' 95~
930 PRINT"
YOU WON, DO YOU WANT TO P~AY"

H

940 GOT a 9&0

950 PRINT"
1 WOk,
DO YOU NANT TO PLAy"
960 PRINT"AGAIN1 TYPE 1 rOR YES AND 0 tOR NO."
970 INPUT Al
980 n Al a 0 TriEN 1030
990 LET MiaS
1000 LET nae
1010 GOTO 200
1020 GOTO 640
1030 PRINT""
1040 PRINT"
OK,
s n YOU LATER.,"
1050 GOTO 1230

LET T • 27
PUNT
PRINT
PRINT
PRINT"TOTAL -",T
PRINT

PRINT
PRINT"
WHAT IS YOUR FIRST MOVU"
npUT Y
GO TO 360
PRINT
1110 PRINT"
THE NUMBER OF MARijLES YOU TUE MUST BE A POSITIVE"
1180 PRINT"INTEGER BETWEEN 1 ANU 4,"
11911PRlNT
1200 PRINT"
WHAT IS YOUR NEXT MOVU"
t'218 PRINT

.m: ~~~O m

I>

YOUR TOTAL 15 7
I PICK UP 1
MARIiILE~
TOTAL
5

rs •

860 PRINT "TOtAL. 0 11
870 LET M1CMI+M

MY TOTAL 15 14

11

8B0 PRtNT"i ttICK UP",M. 1I MI.RBLtS.tI

11~~

21

12

T-'-"

1118
1120
lUll
1140
1150
1160

MY TOTAL ~IS 3

YOUR TOTAL 1 S 3
1 PICK UP 4 MARIiILES,
TOTAL' 11

=",1

1060
1070
1080
1090

= 26

YOUR TOTAL IS 1
I PICK UP 3
KARBLES,
TOTAL • 23

560 LET T-ToM
510 GO TO )00
580 LET MOT
590 LET
/;00 GO TO 830
610 REM 250 IS WHERE I wIN,
620 IF RC4,7 THEN 660
630 IF K>l,S THEN 660
640 LET M-I
650 GOTO 670
660 LET M04
670 LET roT-M
680 LET MlcMl0M
690 GOTO 300
700 RE~: 1 AM KEADY TO ENCODE TH~ STRAT FOR WHEN OPP TOT IS nE~.
710 IF RS.l THEN 1020
730 LET M-R-I
740 LU Ml=MI+M
750 LET TaT-M
760 IF T<,2 THEN 790
710 REM [S • ZERO H~RE
780 GOTO J00
790 REM
ZF.RO HERt
820
830
840
850

AND TYPE

8 IF YOU WANT ME TO GO FIRST
?1

'?1

PRINT"
AND WHAT IS YOUR NeXT MOVE, MY TOTAL U" ,MI
INPUT Y
P$tINTtlll
I f Y<1 THEN 1160
IF 1>4 THEN 1160
IF ycaT THEN 430
PRINT"
YOU HAVE TitlED TO TAKE MORE MARBLES THAN THERF. ARE"
PRINT"LEFT.
rRY AGAIN."
GOTO 350
LET n.YloY
LET T=T-Y
IF TCO THEN 880
PRtNT"TOTAL
PRINT'"
PRINT"
YOUR TOTAL IS • n~1
IF T<, 5 THEN 880
Ion R=T-UINTeT/6)
IF IN1CII/2)=rI/2 THtH 70~
IF TC4,2 tHEN 580
IF R>3.4 THEN ~20
LET M-ROI

sse LET

(2)
~ND

M.2

270 PRINT'TOTAL =",T
280 LET MI=Ml+M
290 ,LET TaT-M
1~0 PRINT"1 PICK UP',M," MARBLES."
110 IF ra0 THEN 880
320 PRINT"TOTAL =', T
330
340
350
]60

THE 2 PLAYERS ALTERNAtE TURNS. WITH EACH PLAYER
REMOVING FROM 1 TO 4 MARBLES ON EACH MOYE,
THE GAME
ENDS WHEN THERE ARE NO MARBLES LEFT, RND THE WINNER
IS THE ONE WITH AN EYEN NUM8ER OF !'IARBLES.

97

PROGRAM LISTING

EVENl

SAMPLE RUN
~:UN

1 P.:INT "GAME OF EVEN WINS - C\'BERNETIC VERSION": PRINT
2

INPUT

E'y'EN1
05: 54 PM
I:JAME OF EVEN WINS -

"00 ..,.'OU WANT INSTRUCTIONS (YES OF.: NO)";Fi$

3 IF A$="NO" THEN 19
4 PRINT:PRINT "THE GAME IS PLAYED AS FOLLOWS:"
0, PR I NT "AT THE BEG I NN I NO OF A GAME, A RANI'OM NUMBER OF CH I PS ARE"
6 PRINT "PLACED ON THE BOARD.
rHE NU~lBER OF CHIPS ALWAYS STARTS"
7' P,:INT "AS AN ODD NUMBER.
ON EACH TURN, A PLAYE,~ MUST TAKE ONE, "
:,: PRINT "TWO, TH.:EE,· OR FOUR CHIPS.
THE ,IlNNH: IS THE PLAYER WHO"
9 PRINT "FINISHES WITH A TOTAL ~WMBER OF CHIPS THRT 15 EVEN. "
1121 PF:INT

"THE COMPUTER STARTS. OUT KNOWING ONLY THE RULES OF THE"

1.1 F'RINT "GAME.
IT CiF.:ADUALL'r' LEARNS TO PLA't' WELL.
IT SHOULV BE"
12 PRINT "DIFFICULT TO 8EAT THE COMPUTER TWENTY GAMES IN R ROW.
1:; F'F:INT "TR't' IT!!

TYPE '0' AS YOU.:

~lOVE.

": PR I NT

I)IM R(L 5) ;f;;:ANDOMIZE
25 L=0: E=(1

"3:121 FOR 1=121 TO .5

AT THE BElli NN I Nil OF FI .GAME..

R RRNC.OM NUMBER Of' CH I PS ARE

THE NUMBER OF CHIPS RUm'r'S STARTS

AS AN ODD NUMBE".
ON EACH TURN, A PLAVEF: MUST TAKE ONE,
TWO.. THREE. OR FOU": CH I PS.
THE WnINE": 15 THE PLA\'ER WHO

TO QU I T AT AN'T' T I ME,

40 F.: (1 .• 1)=4
1~:(0 .•

1)=4
t:::121 I\jE:~:T I
'('0 11=121: E:=0
9121 P=INT( (13:*Fi:NC'+9)/2;'*2+1
:1.0121 IF P=:1. THEN 53:121

our

T'T'PE ...

0~

AS 'T'OUF.: MOVE.

THE~:E

fIF::E 1~i CHIPS ON THE E:OA~:C).
COMPUTER TAKES 4 CHIPS LEAYING 11
THERE ARE 10 CH I PS ON THE E;ORRD.
COMPUTER TAkES 4 CHIPS LEAVING 6
THEf<:E ARE 3: CH I PS ON THE 80AFW.
COMPUTER TAKES 3 CHIPS
GftME OVEF:
'r'OU WIN! !

11121 PRINT "THERE ARE"P"CHIPS ON THE BOARD. "
1.:<:0 U=E
13:121 Ll=L
14121 E=(A/2-INT(A/2»*2
1·50 L=INT«P/6-INT(P{"'6»)*t:+ 5)
11;:!~ 1 F R (E., L) )=P THEN 3:20
:1.701"1=R(I::.,L)
:1:::0 IF M(=0 THEN 3:70
:1.$1121 P=F'-M
:2121121 IF M=:1. THEN 51t1
210 F'I':INT "COMPUTEI': TFlKES"M"CHIF'S LEAVING"P"
2:20 E:=8+M
2:]:0 INPUT M
~:4Q1 M=INT(M)
250 IF M(1 THEN 450
;2t;:1-) IF rl)4 THEN 460
27'0 IF M)P THEN 46£1
:!::::tZt IF M=P THEN 36.0
251121 p=F'-·rl
3:00 A::A+M
]:1121 OOTO 1tH)
:];~:0 IF P"'1 THEN ~,50
3:3:0 PI':INT "COMPUTEF: TAKES"P"CHIF'S"
]:4121 R(E,L)=P
}:50 E:=E:+P
36121 IF 8/2=INT(8/2) THEN 42121
370 PRINT "GAME OVER
YOU WIN! !":PRINT
.3:$10 IF FU E., L) =1 THEN 4:::0
400 R(E.L)=R(E.L)-l
4:1.121 GOT/) ·?0
420 PI': I NT "GAME O'o,IEF:
I WIN!!!": PR I NT
.43:0 GOTO "('.0
450 IF 1"1=0 THEN 570
YOUF~ ~1OVE";
4t;:121 PI': I NT M" I::;: FIN I LLEGAL MOVE
470 GOTO 23:121
4::':121 IF 1': (E1, L1) =1 THE~~ 70
49121 P(EL L1)=R(EL Ll)-l
~;12I0 GOTO 70
~:;:10 P~: 1 NT "Cot1PUTER TAKES 1 CHI F' LEA ....' I NG "P"
~;:20 GOTO 2:20
510 PRINT "THERE IS 1 CHIP ON THE BOARD"
.:i4121 GOTO 120
~:;~5v.1 F'I':INT "COMPUTEF: TFrlINT eN) THEN 310
IF N=11 THEN 18G
IF NH:I. THEN 310
IF N=0 THEN 2~0
IF M=N THEN 510
LET M=N
IF A$IN)="O" THEN 480
LET A$(N)="O"
LET R=TAN(Q-+N/Q-N)-SIN(Q/N)+J:J:6*SIN( 8*N)
LET N=R-INTIR)
LET N=INT(10'N)

4?0 GO TO 610
489 LET A$IN)='X"
499 IF M=N THEN 420
599 GO TO 610
519 IF A$(N)="O" THEN 590
529 LET A$(N)="O"

670
680
690
/00
710
?20
;>]0

INPUT THE NUMBER? 1
:I. 2 3 4 5 67$ 9 10

o

INPUT THE NUMBER? 4

450 IF A$(N)="OP THEN 480

SSO
560
570
580

XXXXXXXXXX

1 2 3 4 5 6 789 10

:1;10 PR INT "I NPUT THE NUMBER";

419
429
430
440

HERE IS THE STARTING LINE OF X'S:

1 2 3 4 5 6 7 8 9 10

000 x x

319 PRINT "ILLEGAL ENTRY--TRY AGAIN"

490

TYPING IN THE NUMBER CORRESPONDING TO THE POSITION OF THE LETTER
SOME NUMBERS, ONE POSITION WILL CHANGE, ON OTHERS .•. TWO WILL CHANGE
RESET THE LINE TO ALL X~ S, TI'PE 0 8 THEN 920','
060 LET M.Q
970 GOTO 1000,'
••.•.
9ee LET Y'Q-B '.,
.' . . ..:
990 IF ABSIQ_10.5).a>3 THEN 920
1000 LET COINTlC-L.IS+23+R"D(XnJ
\BIB LET L'I
.....
1020 IF M07 THEN 1760
1830 IF M.8 TMEN 1920
IU0 LET YI •. Y-I
\050 IF RNOIX»ZIM-I.Yll
10U LET A'2
. \070 GOSue 3020
1080 IF Me. THEN 1110
1090 PRINT "pASS COMP~ETE .. ·I
1100 LET L'SGN I INT(4.RND(0,,)
1110 IF RNO(X)"F2 THEN 2510
1120 IF G>0 THEN 1210
1130 IF G.0 TMEN 117A
1140 IF G.ScI THEN 2170
1150 PRINT "LOSS OF',-G,
1160 GOTO 16\0
1170 PRINT 'NO GAIN"
1180 LET Z9'2
1190 GOSUB '490

102

UII GOTO 1670
121" IF' BoG»99 THfN -1550 ..
1220 PRINT '"GAIN OF·'·,·8,
~..
12~~ 100TO'1-1I,0
... 1240 IF •• 3 .T.HEN i~O
t250 LET 'a·I··
1·2~1l: GOSUB·. :;'.20
.' ..

:m WMme,15.1;~SGN(Y-3)) TH~N

·1360
1290 IF RND(8)e,IS.INTIY/3.bllS THEN 1510
\300 LET Z9'6
Ute GOSue 1490
1320 PRINT -PASS INCOMP~ETE'
1330 LET L'e
1340 LET G.e
13~0 GOTO 3\20
\360 PRINT 'PASS •• INTERCEPTED •• " I
1370 Ln A'1
. \350 GOSUB 3ue
\390 IF Bot40 tHEN 1410
1480 LET G'·200(l.SGNIGll
141m ~ET B'110-B-G
1428 LET $'3-S
lUI LET Z9'9
1440 GOSUB 1490
ItU IF Bel THEN 710
1461 If B'99 THEN le5e
1470 PRI~T "AT ,~
'1480 GOTO 2360
1490 ~E.T C'C-INT 14.Z_912. I 10RNOle))).
1500 RETURN
ISI0 LET Go.CS.INTI\0.RNDIX).ll
1520 PRiNT 'THE IiUARTERS'ACK '1
1530 IF RNDIX)',5 THEN 1560
1540 PRINT 'IS THROWN FOR A '1
1558 GOTO 11\0
1560 LET G'~12.G.8)
1570 LET M'b
IS80 LET hi
1591 PRINT 'SCRAMBLEs FOR A".
-1610 GOTO II \0
\510 LET 8.• 6.G
1620 PRINT 'TO" I
1630 GOSUS 3300
\540 IF 8e'99 THEN 1570
1651 GOSUS 1990
1660 GOTO 630
1670 IF 81.8 THEN 3120
1680 IF Ble8 THEN 1730
169, I.F RND(0l' •.5 THEN 17.30
1700 PRINT ·*,.MEASUR~!'IENT.o"
1710 GOSue 3520
1720 IF RNOIXle,5 THEN '3120
1730 GOSue 2na
1740 LET 0'0
1750 GOTO 3120
1760 IF RNOIx)e,06 THEN 1890
1770 LET 8.80300INT(IS.(\-RNDIX).3"
17$0 ~ET· Z9'2
17.90 GOSUB 1490
18U· .. IF 8coc!l9. THEN le50
1810 LtT PI.3:
.
.. 1820' GOSlie. 203.·0
18311 IF' PI,,'e'THEIIf'710
1840 'IlOtO'e~0'
1.850 pAINT "T'H.E KICK l.S !II.'
18~0' LET Z2',0' "
18tll.LET S'l.,S
\880:. GOTO ·U40-.
. ·;C ." ' .•.
1890 PllI.NT .""BLO·CKED'" RECOVE~Etl,,",
1900 ·LEr·G'·INT(IA.RN.DIX) l .
.
1.9teGOTO l4t0
'.
··Inl PRINT" "THE. PUN.TIS '1
'\9.30 IF AN·~.(·X)~;:06.:·TH~N U9~
IU8 LET flo;B.
.
l-g50. LtT.
1950 LET S'l-S
.1-970 LU Z3. ,.65
. '1980 'GOTO .6~0
1990 ~INT. "00 TIlUC... DOWN •• •·
2000 L.El -1>1'1 ".. .
.....:"
2010"~ET P(8)';I>(s)+6.
2020 LET , S ' 1 3 · 0 .
.·2030 PRINT .THE.KI:C~" IS oj.
:aS40 If"RNDIx)eIBIl32l.4 .THEN i~7ii
2~6'0 ~E'f P I"e
". .
2050- 'P'RINT .."NO .,
2070PRIWT ··~OOD·.
"2080 LET· ... tSl.p.ISl.Pt·
2~911 'Gosyil 2120
2.fBII Lt.T SOJ"S.
. .. ,

Z2o, .

:H: :m~N.smE' ~E"~(I)i.::~cf~,ioI2)

a}Jj!'LET L'II :
..... ,' .. :'i'2f40 IF xe! THEN. ,,2150
2-150 IF P!I)c>P(.2) THEN 2710 "
. 2.1~0 RETURN·
.:.
. '.:217. PRINT • . . SAFETY ••- ".
218', LET PI'3-S)'PI3-S.'oZ .
2l.~ LET FI'J0
. ',.
2200' LET S'·3-S "..
..
. ......
.,2U0 'GDSUB 2,128 .
2220 GOliUiJ..344.1!. .
223S·. PRI N'" 'FROM. THE 20·'
22.40" GOTt) ~5,". ' "."
2250' . GOSUB·"344.'. " "
U60·.. IF S,'2 .i~E-N 2330
. 2270 PRINT' >O'f,j-SIOE:RI
2.Z~0GOSUB:36i0
" ..
22Q0'·lF:. .Q~>\3 THEN 2330
a3S0 LET ,2';,15
23\0 LET Z2.1
2320 LET 0'1
2330 RETURN
2340 LET B'1II0"8
2350 PRINT "RECEIVED AT "'
2300 GOSUS 3380
2370 IF ZZ.RNDIX)'Z3 THEN 2400
2380 IF RNO(x)eF2 T~EN 2500
230m LET G.e.INT I UhRND(0))

.

!

2400
2410
2420
2430

IF RNO(0) •• 15 THEN 243~
lET GoINT(24-Cl-RND(X).2))
IF G00 THEN 2490
lET BoB+G

2440 PRINT
2450
2460
2470
2480
2490
2500

~

A~D

RUN BACK ••• p,

lET lOI
IF B.99 T~EN 1650
PRINT' TOil
GOSUB J3~0
IF RND(0»F2 THEN 3260
lET G00

2510 PRINT "**FUMBLE**"'
2520
2530
2540
2550
2560
2570
2580

GOTO 1410
IF Sol THEN 2560
lET VoINTC1+3.5-RND(0»
RETURN
lET MaINTC55_RNO(0)110.5)+1
IF (61-6)1(5-0)(3 THEN 2590
lET MoINT(b.4-RNO(0).2)

2590 If L*F_60>-C THEN
2600 IF 0<4 THEN 2550

LET M,e
RETURN
PRINT 'GO FDR IT'
RETURN
IF X.4 THEN 2830
IF P(\)=P(2) T"E~ 2B30
PRINT "THE GAME IS OVER"

2800 PRINT

~FI~AL

"I

2840
2850
2B60
2870
2880
2B90
2900
2910
2920

"F-NO OF PERloDlIlX

GOSUB 212"
LET fo\-F
GOSUB 3520
LET C'90e
LET X-X+I
IF F ••• THEN 810
LET S.3-K
GOTO 580
IF Tl 0 • THEN 2770

2930 PRINT "2 MINUTE

2940
2950
2960
2970
29B0
2990
3000
3010
3020
3030
3040
3050
3060
3070
3080
3090
3100
3110
3120
3130
3140
3150
3160

WARNING"

AND",Bl-B,tl

"'

327121 PRINT "MY "I
3280 GOTO 780

32g0 PRINT "BALL ON "J
3300
3310
3320
3330
3340

IF B'5~ THEN 3400
LET V'50-A~S (B-50)
LET C=C.INTC70J-RNDC0n
IF 5'1 T~EN 342.
IF B<50 THEN 3370

335~

PRINT "MY "J

3360 GOT a 33B0

3370 PRINT "YOUR ",

3380 PRINT V
3390 RETURN

3400 PRINT "THE 50"
3410
3420
3430
3440

RETURN
IF B.50 THEN 3350
GOTO 3J'70
IF 5'2 THEN 3470

3450 PRINT "YOU'"

3460 GOTO 3480

341121 PRINT "I"J
3480
3490
3500
3510
3520

PRINT" KICK OfF.'
LET F2'.06
LET Z2'0
RETURN
LET L-0

3530 PRINT

3540 PRINT
3550 RETURN

~mEN

HO,

INSTRUCTIONS FOR PLA',.'ING FOOT8ALL ..

"TIME:.OUT CA,t.LED . . . "

TYPE A 1':' 1

IT ASkS ',.'01) A QUESTION TO BE ANSWERED 't'ES OR
IN t.) FOR NO OR 1 FOR 'iES.

TYPE

ON OFFENSE 'iOU HAVE THt: FOLLOlHNG PERMITTED PLA'T'S'
PLA',.'
CODE
HUN
10

PRSS

11
12
13

51~EEP

SCREEN PASS
L.ONG PASS

14
1~

Df"FH~ PLAY
PUNT
f']ELDGOAL

16.

17

~EFENSE,

',-'OU

t'1A~'

DEFENSE

CO[)E~

tWRt1AL

4

HOLD

5

Tf~'l'

ONE OF THE

FOLLOl~

I NG'

GOOD FI13AINST SWEEP ANe, ::.CFiEEN
GOOD AGAINST Ft'UN. PASS AN!) C,r::!iH
GOOD AGAINST PASS OR LONG PASS
I NCFt:EFiSES THE ODD::, FOR AN I NTERCEF'T"I ON
(i 1 VES ',.'ClIJ A CHANCE TO E:LOCK A I< I (:1<.'
BUT DECf':EASES THE D I STANCE F:UNE:ftCK

TO UiLL A PAF:T 1 GULAR PLA'l' .JUST T',-'PE ITS COrlE NUME:EF:
ALSO, AT Ati'r' T1t4E DUFt:ING F'LA'l' ','OU MA'1' CALL TIME OUT
8',-' TYPING A 2'
HOLJE"iEFt: 'T'OU ARE PERMITTED ONL." THREE
T lt1EOUTS PER HALF

DO YOU

l~ANT

TO RECE I "iE? 1

[ f( rCK OFF
TOUCHBACK
YOUR Bt1LL Ot~ 'r'OUR

t1

20

14 t-1 HL 42 SEC
';'OUR PLAIn 1(1
LOSS OF 1 TO 'r.'OUR 19
2tH! AND 11
TU1E TO 130-- 14 t4IN,

34 SEC

'r'OU~:

PLA'T'? 12

LOSS OF ~~ TO ';'OUR
17
3RD AND 1:?
TH1E TO 130-- 14 t1HL
PASS GOt1F'LETE
GAIN OF 12 TO 'l'OUR

1] SEC.
'r'OUP F'LA""~' 1129
4TH ANt- 1
TH1E TO GO-- 1} MIN, 4]: SEC
't'OIJR PLA.,,··:-- 11:3
OfllN OF 113 TO 'T'OUR
3:9
1ST AND 10
TIt1E TO 130-- 1] t1IN .. 24 SEC
'l'OUFi PLA'r";:- 11
f)f-iSS COt'iPLETE
Gti! N OF 7 TO ','OUI':
46
2ND Rrw 1
T1t'1£ TO GO-- 1]: t·lIN .. 8 SEC.
'l'(lUP PU1'.'? 14
PRSS INCOl'lPLETE
JRD RND
12 t'lHL ]2 SEC
'T'OUP PLA'T'? 15
CiHIN OF 2 TO 'r'OI)R 4:::
4TH mw 1
TINE TO (iO-- 12 t1IN .. 24 SEC
'r'OUFi' PLf!"'? 10
GHIN OF '.5 TO Wy' 47
1ST Arm 10
T H1E TO 130-- 1~' 111 N. 4 SEC.
'l'OUIi' PLA""-; 14
PAS::;

:~RD

3200 IF 0.4 THEN 3220
3210 PRINT 114TH'"
II

YOU NEED

f)RS5

"3RDIIJ

PRINT

IF

;nw

31B0 IF 0<>3 THEN 3200

GOTO 810
LET S'j-S
LET B'l.~-B
IF S=2 THE' 770

SAMPLE RUN

lHlS IS A DEMONSTRATION OF PDP-i1 BASIC

BLOCK

3170 PRINT '!2ND"J

322~

3730 END

INTERCEPT

h'

3230
3240
3250
3260

,5'''2, .25, 4, .5,13, .55
.4,"2, .3,7, .65, 15, .75
,4, .. 2, ,3,6, .6, 15, ,35
.65, .. 2,.65,6H6,11,,9
,4,2,,7,10,,4,27,,2
,1,19,.4,35,.2,100,.1

BLITZ

GDSUB 3520
LET TI=.
LET C=120
GOTO 880
LET 81,eo10
If 81.'100 THEN 3°1"
LET Bl 0 100
RETURN
LET g=I.3oCA.RNO(0).Il·.06
LET
IF Q.-0 THEN 3070
LET A=0
LET Q=-Q
LET Ml,M-1
LET G'D(A.MI)+FNT(Q)'CDC2.~I)-DCA.Ml))n.5
LET GoGoINT(RNOC0l+.02)OAoI00oRNOC0'
LET G'INTCG)
RETURN
LET 0=001
IF 0=5 THEN 3240
IF Dc>
I THEN 3160
PRINl "18TII;
IF 0<>2 THEN 3180

3190 PRINT

DATA
DATA.
DATA
DATA
DATA
DATA

ON

2810 GOSUB 2120
2820 STOP
2830 PRINT

3670
3680
3690
3700
3710
312121

FOOTBL

IF 6.55 THEN 2720
IF 0.4oRNO(0)-BloB THEN 2750
PRINT 'T"Y FOR A FIElO GOAL'
lET Ma 7
RETURN
IF P(2)oU2coPCl)oU2 THEN 2600
p~INT "TIME OUT"
LET U2'U2.1
GOSU6 3520
GOT a 2600

2720 PRINT "PUNT"
2730
2740
2750
2760
2770
27B0
2790

IF U00 THEN 3600
LET UaU-l
GOSUB 3520
GO TO 3610
PRINT" •• "RDNG. TRY AGAIN"
INPUT A
IF ABS(INTCA))>17 THEN 3600
LET QoR(INTCABS(A)))
IF Qo. THEN 3600
If Qol"0 THEN 3560
RETURN

267~

2610 PRINT "I III '"
2620
2630
2640
2650
2660
2670
2680
2690
2700
2710

3560
3570
3580
3590
3600
3610
3620
3630
3640
3650
3660

ING(H1PLETE
fU·W 10
11 inN.
I NCOt'lPLETE
Arm 1~)
11 t1H~.,

46 SEC

'l'I)Uf;' PLA'T''? 14

'T'OUIi: PLA'T"~' 11
PASS COt1PLETE. GA IN OF 1:3: TO t1'1'
34
1ST AtW 10
11 inN, J1 SEC
'T'OUIi' PLA.,,·? 10
GRIN OF 1 TO M';' 3]
TII1E TO 130-- 11 t~IN~ 22 SEC
2tm AND '3
NO GAIt"
:tRD AND 9
T !t1E TO
1~) t1I N,
51 SEC.
'r'OUP PLA'T') 1]:
PAS:::: COt1PLETE
LOSS OF
TO t1'T'
:3=4
4 TH AND 10
T HlE TO 130-- 1~3 MIN, ]:6 SEC
'T'OUIi: F'LfI"') 17
THE 1::ITIES
SUCH A GAME
9 REt1
19 REt1
10e RANDOMIZE
121.3 DIM A':2e), 8(2121), C(40) .. H(2), T(;2), W(2), :~CV., YC') .. Z(;2)
:130 DIM M$(;2), D(2)
140 PRINT "RAMIS ENTERPRISES PRESENTS N. F. U. FOOTBALL: ': T) THEN 11.;2121
~l500 IF lHT)*P}=Z.'5 THEt~ 88.'5
:116121 PR 1 NT\PR I NT "CONVERS I ON UNSUCCESSFUL TEAM" T'\T==T (T)
1.170 GOSIJB 185il1\QOTO 880
:11813 PRINT "DOES TEAr~"TMWtmT TO P!JNT".; \INPUT FI$
1185 IF AJ="NO" THEN 1200\JF A$<)"YES~ THEN 1180
1190 PRINT\PRINT "TEAM"T"WILL PIJNT"\(j==F~ND(CI)\IF 13<.025 THEN 1121:::0
1"195 GOSUB la50\K=lNT(25*RNC'(0)+},'5)\h'T(T)\t~I)TO 7'$10
:l.?0e PR 1 NT "DOES TEAt~" T" WANT TO ATTEMPT A F I ELD-t30Al ".: \ J NF'UT A:t
1210 IF Af="YES" THEN 164/21\JF A'{)"NO" THEN 12ge\60TO 928
~L.?30 PI<: I NT\PFl~! NT "SAFET't' AGR J NST TEAM" T" --~-- .... ---·-- .... ·-------OH-OH"
:L240 H{T(T)=H(T{T»+2\G05IJB 1$10
12813 PRINT "TEAM"T"DO 't'OI) WANT TO PUNT INSTEAD OF t=I KlCKOFF".; \IN?l)T A$

:l730 PRINT"SAI.L

760 PRINT\PRINT 'THE COIN IS FLIPPED'
~:>65

"QUARTERBACK

16$13 P""P-l~ (T) *F\RRNC'I)M I ZE\G=RNO (I:,)
:L6ge IFG<.3STHEN17:?5
~l7e0 IF Y(T)*P{X{T) THEN 1740
:1710 F'F I NT "F I ELDGOAL floor' FOR TEAM
1726 0-=3\I)OTO 1190

680 IF L=20 THgN 410
690 D(1 )=0\0 (2 )=J;\M$ (1)= " __ -~' "\M:t ~:2)=" ( ___ "
'?OO H(1)=0\H(2)=0\T{1)=2·...,T(2):;:1
?1~3 ~~ (1)
:1, \1.01 (;2) ::;l\X (1) =100\:X: (:2) =13
~'20 'T'': 1) =l \Y (2.) =-1 \2': 1) =0\2 <:2) =100
?25 GOSUB 1910
730 PRINT "TEAM 1 DEFENDS J.3 YD. 130AL--TEAM
749 T=INT(2*RND(O)+1)

G=RND((I)\IF G<.025 THEN 1040\IF ¥)2 THEN 1045
PRINT

PRINT "PASS COMPLETED"\GOTO 1050
PRINT "THE BALL WAS RUN'
P=P-W(J)*¥
PRINT\PRINT "NET YRRDS GAINED ON DOWN"D"ARE ",'
:H37t3 G=RND(O)\IF G). 025 THEN 1110

230 PRINT "ASKED THEN.

380
410
420
430

PRINT ..... IF T=2 THEN 1015

1010 I F A (Pi) (11 THEN 1048\80TO 1020
1015 IF S(P2)(11 THEN 1048
:l020 IF 1)00 THEN 1035".PRINT 'PASS INCOMPLETE TEAM"T

~L900

F'RINT TAS{D(T)+5+P/2).; 1'1$(1)

1911 PRINT "TERM 1 [0
J TEAM 2"
J92e PRINT
L~30

THEN 898

RETURN

:1000 END

104

"of ... +++++ + ... + +++++++++++++ +++++++ +++++++++++++++ +++++ +++ +++++++

1870 RETURN
10

28

30

41

51

70

100

SAMPLE RUN
RAMIS ENTERPRISES PRESENTS N. F. U.

FOOTBALL<:PEDITJON.
HOI~

YOUR 190 FURS ARE DISH:IBUTED AMONG THE FOLLOWING
MINK, BEAYER, ERM I NE AND FOX.

t1ANY BEAYER PELTS DO ,'Oll HAYE? 50

Ie I NDS OF PEL TS:

HOI~ tiANY ERM I NE PELTS DO YOU HAVE? 40

HOI~

HOI~ t1AN,' FOX PELTS DO ,'Oll HAYE? 40
DO YOU WANT TO TRADE YOUR FURS AT FORT 1, FORT 2,
OR FORT 3?
FORT 1 IS FORT HOCHELAGA (MQNTREAl)
fiND IS UNDER THE PROTECTION OF THE FRENCH A.:MI'.
FORT 2 IS FORT STADACONA (QUEBEC) AND IS '-'NDH: THE
PROTECTION OF THE FRENCH ARMY.
HOWEYER, ,'01.1 MUST
MAKE A PORTAGE"AND CROSS THE LACHINE RAPID~
FORT ] IS FORT NEW YORK AND IS UNDER DUTCH CONTROL.
YOU MUST CROSS THROUGH I,:OQlI(oiS LAND.
ANSI~ER 1,
2., OR J.
c· 3
YOU HAVE CI{OSEN THE NOST DIFFICULT ROUTE.
FIT
FORT NEW YORK 'T'OI) WILL RECEIVE THE HIGHEST ..... ALUE
FOR YOUR FURS.
THE COST OF 'T'OUR SUPF'LIES
WILL BE LOWER THAN RT ALL THE OTHER FORTS.
DO YOU WRNT TO TRADE RT ANOTHER FORT?
ANSI~ER YOS OR NO
", NO

MANY MINK PELTS DO '~OU HAVE? 50

HOW t1ANY BEAVER PELTS C'O YOLI HAVE" 40
HOI~

MANY ERMINE PELTS DO I'OLI HAVE? 50

HOI~

MANY FOX PELTS DO YOU HAYE? 50

L)O YOU WANT TO TFi:ADE 'r'OUR FURS AT FORT L

OR FORT]:1

FORT 1 IS FORT

HOCHEL~GA

FORT 2,

25THEN760
6,ePR I NT" IN TR·AP" \LETC=ABS (H-X CD) )\GOT0680
68ILETL8=INTeRND(X)010)
690IFL8)lTHEN680\IFL8=1THENB50
700LETT2=0
710FORZ=1 TOLB
n0LETT2=T2+1
"l30PRINT"CHOSE YOUR CLUB"\INPUTX
H0PRINT"STILL IN TRAP"\NEXTZ
75000T0850
'/60 I FL = 1lTHEN780\ I FL=B8THEN7B0
770IFLC)25THENB00
780PRINT"IN ROUGH"\LETC=ABSIH-XeD))\GOTOB50
790IFL=69THEN810\IFL=73THEN810\IFL=ITM A MARKER. THE OBJECT OF THE GAME IS TO GET"

UELCOME TO THE ORIENTAL GAME OF GOMOKO

3~ PRINT

"5~tJACo"T "-A~ll:]N- A ROw •• HORIZONHLLV.,

60 PRINT "ALONG EITHEH pIAGCNIL.
70 PRINT

11~1ARI\Er!

WlTI-t A

'1

A~O Tlolf. cnMPlJTE~ MOVES
un~s NOT KfEP TRACK OF

1,

80 PRINT\P"",T "THE CO'PUTE'·
90 P~INT

"to

Et-!D HIE. GAttE;

nN THE 60.Ro

vERTICAI.LV, OR"·
DIAGRAM. YOUR MOVES ARE"

TVPE

\NITI"I A 12

1 ."

WMO HAS WON."

'-1,-1' FOR YOUR MOVE"\PRINj

110 PRINT "IlHAT IS YOUQ 60AI-'O SI7E CrotIN ./,
115 IF N., THEN li7

~IA)(

=

t9) 1I 1'INPUT N

THE COMPUTER DOES NOT KEEP TRACK OF WHO HAS WON.
TO END THE GAME, TYPE • -1, -1' FOR YOUR MOYE

116 I:OTO 120

117 I' NC2~ THH J'e
120 PHI"T "I SilO, lH~ MI.!, UM SIZE IS 7. "'0 Tt.E MAXIMUM IS 19,"\r,OTO 110
21V FOR I-I TO 'vaR JOI TO "\ACX.V)-@\~EXT .l\NEXT I
300 P~INT\PHI'T "-E AlTE~NA'iE "UV'.S,
VOll (;0 FIRST .. ,"\PRI"T
31~ PRINT "YOUR PL~Y-n,Jj":\l"PlJT I.J
320 IF r __ 1 reE'· 9~~
3J~ Xor\YoJ\GCRlJB Q10\tr L-t THE" 'I~
340 PRINT "ILLEGAl. r-tOvF.. TR, AGIIIl\I ••• t'\GOTO 310
410 IF I(I.J).~ THEN .40
42((1 PRI~!T I'S(.lUARE OCCUPIED. TRY AGAI~ ••• "'GOTO 31~
440 A(!,Jjol
5~~

REM ••• CQMPUTtR

TRI~S

6~.

flNT(LLIGE~TI

51" fOR E-·I T.O I VOR Fo·1 ., ~ 1\ rr
54~ LET X~I+F\LtT V.J+F\G05U8 91~
570 IF Lo. THfN 59.

E.F·E'Fo~

MOVE •••
THfN

59~

,\NExT

600 REM •••

E

cn~PllTfR

TRlts •

~A~~OM

~ov~

•••

61. LET X.I~T('''RNrl(.l).I'LfT YoINT(RND(0ll+!\G05Uij 9H'\1F La, T"~N ~10
65~ IF A(X,Y)<>{ TH~~ ~1~

66W

ACX,Y)a2'GOSU~

81~'GOrn

311~

71"" Jt=! ... E\'vaJ.F\GIJSIJl;, QUJ
75!it 11- L.lrlfl ft-tl:.:\i ~qia

98~

"T~.N~5

(J

FOA

T~E

0
0

0
0
2
0

0
0
0

0
0

0

0

0

0
0

0

0

000
000
000
000
000
o 0 0

f}.

0

0

0

0

YOUR PLAY
0
0 0
0
2 0
0
0 1
0
0
0
0 0 0

0
1
0
0
0
0

e
0

0
0

0

e

0

0
0

o.

0
0
0
0
0
0

o
o

o
1
o
o
o
o
(I.

0
0
0
1
0
0
0

0
0
0
0
0
0

5.5

(I,J)?

e e e

0
2
0

GA~~1Ih

Fi)k. YES,

YOU GO FIRST.

YOUR PLAY (I.J)? 4.4
e 0 0 0 0 0 0
9
0 0 9 0 0 0

2

L=l~'QETU~N

PPINT\PRI~T

Qh!5 PRINT uPLAY 6,GA.I""
Q90 IF Qa1 TloIfl'l 110
999 f"O

WE ALTERNATE MOVES.

o

7t;~ r,OTO ~5~·
8~~ RE.M ..... plofh·r ThE 80AJ.i!)
81121 FOR 1=1 TO ~,\F(1R J=l TO N,p~II\;T 6(I,J)J
840 '~.T J'PN,.T \.tXT '\.NJ'T \RtTUR.
9~1i'! Rt:-.M ..... C' .. EC~ ',;.,ETl-lfR MLv't: IR U:GAL •••
91~ Lal\IF Xci T"ON 97,.9::!!7' IF x>~. THE~· 970
q3~) IF 1«1 T~E.'\; 971
94r IF y>~ THE~' 07~
95. PETU.,·,

979' LtT

IIHAT IS YOUR BOARD SIZE (MIN =7, MAX = 19)? 8

'lOUR PLAY

560 IF A()t.n"l TNEoN 7IP,

590 NEXT

THE GAME IS PLAYED ON AN N BY N GRID OF A SIZE
THAT YOU SPECIF~
DURING YOUR PLAY. YOU MAY COYER ONE GRID
INTERSECTION WITH A MARKE~
THE OBJECT OF THE GAME IS TO GET
5 ADJACENT MARKERS I N A ROW -- HOR I ZONTALLY. YERT! CALL y, OR
ALONG EITHER DIAGONAL.
ON THE SOARD DIAGRAM. YOUR MOVES ARE
MARKED WITH A 'I', AND THE COMPUtER MOVES WITH A '2'.

0
0 0
0 0 0
0 0 0
000

1

0

0

020

000
000
J>? :l,:l
0 0 0
0 0 0
0 0
0
0 0
0
1 e 0
0 2
0
0 e 0
0 0 0

YOUR PLAY ( i . n ? :l,5
e e 0 e 0 0 0
e 2 0 0 0 2 0
e e 1 e 1 0 0
0
0
0
0
0 0 1
0 0 e 0 1 e e
0 0 0 0 2 0
0
2 e 0 0 e e e
0 0 0 0 0 e 0

F()R NO)"'\II'.,PI,.!T g

YOUR PLAY (I.J)? 5.3
0 0 e 0 0 e 0
e 2 0 0 0 2 0
e 0 1 0 1 0 0
e 0 0 1 0 e 0
e 0 1 e 1 e e
e 2 e e e 2 0
2 0 e 0 e 0 ~
9

0

YOU~

2
0
0
9
0
0
2
0

0

0

0

0

0

PLAY (I.J>? 4,5
0 e 0 0 0
0 0 0 2 0
0 1 0 1 0 0
0 0 1 1 0 0
e 1 0 1 e 0
2 0 0 0 2 e
e 0 0 0 0 0
0 0 0 e 0 0
0
2

YOUR PLAY (1.J)? 4,3
2 0 0 0 e 0 0
0
2 0 0 0 2 e
0 9 1 0 1 0 0
0
0 1 1 1
e 0
2 0 1 0 1 0 e
a 2 0 0 0 2 0
2 0 0 0 e e 0
0

0

0

0

e e

0

0

0
0

0
0
0
0
0

o

o
o

o

o
o
o
o
0
0
0
0

e
0
0
0

e
0

e
0
0
0
0
0

0

e
0
0
0

e
0
0

e
e
0
0
0
0
0
0
0
0

e
e
0

e
0
0

YOUR PLAY (I.J)? 4,2
2 0 0 00000
o 2 0 00200
o 0 1 o 1 e e e
e 1 1 1100·0
2 0 1 o 1 e 0 e
o 2 0 o a 2 e 0
2

·0-

0

2

0

0

o

o

0
0

0

0

e

000

YOUR PLAY n, J)? 4.5
SQUARE OCCUPIED. TRY AGAIN.
YOUR PLAY n, J>? 4.6.
200 0 0 0 0 0
2
0 0 200

o

e

001

e

1

0

0

1

1

1

1

1

0

0
2

1
0

0

1
0

0
2

2
0

0

0
0

0

0

0
0

o
2
o
2
2

e

YOUR PLAY

e
0
0

e e

(I,

J>? -1,-1

0

e
e
e
e
e

THANKS FOR THE GAME!'
PLAY AGAIN (1 FOR YES, e FOR NO>? 0
READY

112

PROGRAM LISTING

SAMPLE RUN

1 PRI "THIS IS A NUMBER GUESSING GAME.
I'LL THINK'
2 PRI "OF A NUMBER BETWEEN 1 AND ANV LIMIT YOU WANT.
3 PRI "THEN YOU HAVE TO GUESS WHAT IT IS.
4 PRI
5 PRI "WHAT LIMIT DO'YOU WANT',
6 INPL
7 PRI
8 Ll=INT(LOG15 THEN 495\PRINT "NICE SHOOTING!! "\GOSUS 680\GOTO S09
495 PRINT "BETTER GO BACK TO FORT SILL FOR REFRESHER TRAINING!"
509 PRINT\PRINT 'THANK YOU FOR PLAYING!"
50215 PRINT\PRINT "TRY AGAIN ..... "\PRINT\GOTO 189
60021 . FOR N=1 TO 1e,PR I NT CHR$ (7), \NEXT N
619 RETURN
999 END

0,

THIS COMPUTER DEMONSTRATION SIMULATES. THE
RESUL TS OF fiR I NG A FIELD AR. I LLERY WEAPON.
YOU ARE THE ·OFFICER-IN-CHARGE. GIVING ORDERS TO THE GUN
CREW. TELLING THEM THE DEGREES OF ELEYATION YOU.ESTIMATE
"'ILL PLRCE THE PROJECTILE ON TARGET.
A HIT WITHIN 188 YARDS
OF THE TARGET WILL DESTROY IT.
TAKE MORE iHAN 5 SHOTS.
AND THE ENEMY WILL DESTROY YOU!
MAX I MUM RANGE OF YOUR GUN IS 46588 YARDS.
DISTANCE TO THE TARGET IS 41757 yARDS .....
ELE"'ATION:? 35
OYER TARGET BY 1937 YARDS.
ELEYATION:? 3l
OYER TARGET BY 721 YARDS.
ELEVATION:? 31.8
S.HORT OF TARGET BY 188 YARDS.
ELEYATI ON:? 31. 9
** .. TARGET DESTROYED*""

4 ROUNDS OF AMMUNITION EXPENDED

THE FORWARD OBSERYER HFiS SIGHTED MORE ENEMY ACTIVITY.
DISTANCE TO THE TARGET IS 21460 yARDS .....
ELEYATI ON:? 16
O...ER TARGET BY li8e YARDS.
ELE~'ATI ON:? 13
SHORT OF TARGET BY 11177 YARDS.

ELEYATI ON:? 14. 3
OYER TARGET BY 798 YARDS.
ELEYFtT I ON:? 13. 8
.. .,.. TARGET DESTROYED***

4 ROUNDS OF AMMUN I TI ON EXPENDED

THE FORWARD OeSERI/ER HAS SIGHTED MORE ENEMY ACTIVITI'.
DISTANCE TO THE TARGET IS 14~43 yARDS ....
ELEYATI ON :? ~
SHORT OF TARGET ev 575 YARDS.
ELEYATION:? 9.5
OYER TRRGET 8 ... 195 "'ARDS .
ELEYATION:? 9.3
SHORT OF TARGET BV 113 YARDS.
ELEYATI ON:? 9. 37
...... TARGU DESTROYED"**

4 ROUNDS OF AMMUN IT I ON EXPENDED

THE FOR NARD OBSERVER HAS SIGHTED /lORE ENEMY ACTI V ITY.
DISTANCE TO THE TARGET 15 39518 VARDS.

READY

ELEYATION:? 28
"*.. TARGET DESTRO ... ED ......

1 ROUNDS OF AMMUNITION

E~PENDED

THE FORWARD OBSERVER HAS SIGHTED MORE ENEMY ACTIVITY.
DISTANCE TO THE TARGET IS 28617 yARDS ....
EL.EVATI ON:? 21
OYER TARGET BY 24S15 YARDS.
ELEYATI ON:? 19
...... TARGET DESTROYED"**

2 ROUNDS OF AMMUNI TI ON EXPENDED

TOTAL ROUNDS EXPENDED W£RE 15
BETTER GO BACK TO FORT SILL FOR REFRESHER TRAINING!
THANK YOU FOR PLAYING!
TRY AGAIN .....

116

GUNERl

SAMPLE RUN

PROGRAM LISTING

I ~~ R~M A!!TILU'I1Y "IRINr, GAI'IF
lie DIM A~O)
Ille RANDOMIZF
I ~~ PRINT "DO YOlI ~IANT INSTRUCTIONS";
I~e INPUT A'
I~~ PRINT
16~ I, A~="NO" Tl!~N .,,'~
170 PRINT"
THIS ~A.,r TF!;TS YOllR ABILITY TO HIT A MOVING TARGET."
180 PRI NT "YOll MUST n~~TROY IT RFI"ORE IT DESTROYS YOU OR MOVES OUT"
190 PRINT "0, RANGl'. THF TARG,T "'ILL MOVE RAMDOMLY."
200 PRINT
210 PRINT"
TYPF CTRL/C TO TFRMUATE THE PftOGRAM. TO THE IiIUESTON"
220 PRINT "'FNT,R SPF'D' TYPF A NUMBER BETWEEN I AND 180. THIS IS THE"
230 PRINT "RELATIVE SPl'ED OF THF TARGFY WHFRE I IS THE SLOWEST AND 100"
2~0 PRINT "IS THI' I"ASTEST."
2~0 PIlIN!!
2S0 PRINT "TO THI' ,,"UFSTION 'FNTFR DISTANCF' ENTER THE MAXIMUM DISTANCE"
270 PRINT "YOU CAN HIT 'ROM THF TARGET AND STILL DESTROY IT. THIS IS"
280 PRINT "iHl' 1 life THEN ,'~0
PRINT "FN'!'F~ OISTANCF":
INPUT D
II' D.0 T""N .'70
I" D-10000 THEN 370

4U M=l000fJ0-75~fJ0*RNDC0l
420 PRINT
~30 PRINT "THF MAXIMUM ~~NG" 0" YOUR GUN IS "1'1" Y~IlDS"
440 FOR W=I TO 1'1111'1008
Ll"T KI=RNOC0l
460 NFXT K

'.0

~70 !!=.q~*M-,6*11*~NO(0)

480 LFT N=~
'90 r-OTO '20
~00 I" R>M THFN R40
511'1 II' R.=CM/2.5l TlI,N 85V
520 PRINT "TARO!'! RANG" I~"R" YAPDS"
530 PRINT "n,VATION",
54P. INPUT"
551'1 I" £.1'1 THFN R40
56~ I" F> 89 THEN 800
570 I' F D THEN 121'1
53fJ IF 1(.-0 THF'M 740
';41'1 STOP
5~0 PRIN, "*** TA~GFT D"ST~OYFD ***"
SSI'! r,OSUB 940
570 DI=K
58A "OR K=I TO N+01l00
590 ~1=RNDCfl)
700 NFXl ¥
710 MTO 410
72fJ PJ!INT "SHORT ~I" TARG"'!' 8Y "1(1" YAROS"
730 MTO 74741'1 PRINT "OV,II TAROn ~Y ":¥I"Y~ROS"
74- LI'T C=INTC2*RND (0)+J)
74~ II' C=I TH"N 7.'"
748 U'T C=-I
749 GOTO 7f5~
7~0 LET C= I
760 CI=M*S/llIfI*RNDC0l
771'1 CI:C*CI
7811 R=!!+CI
798 GOTO 5~e
8~~ PRINT "MAXIMUM F'VFVA!ION IS 89 DF'GR£ES"
RI~ GOTO 53~
R2A PI'INT "I'IINII'IUM ,LFVATION IS I OFGRH"
1138 GOTO ~3e
84r PRI NT "* TAROn OllT 01' R~ NGF' *"
GOTO 67e
86P PRINT "THI' TA'lG~! liAS D"!lTROYl'D YOU I"
117~ noTO 67e
Q4" I" N:I THFN '178
9~~ PRINT N" ROlIND~ ~)(P"N!ll':D"
968 "nU"N
q78 PlInT "***U DIRFCT HIT *"''''u"
91" 'lfTUftN
990 END

""J

117

DO vOll W_ ~T I NST"llCT IONS' YFS
THIS GAI'I" TFSTS YOIIR A!'IILITY TO HIT A I'IOVIHG TARGET.
YOU MUST D,STROY IT S"I'ORF IT DESTROYS YOU 011 MOVES OUT
0" lIAHGF. TH, TARGFT WILL MOVE RAMDOI'ILY.
TYPF CTRL/C TO TE!!MINAT; Til, PROGRAM. TO THE QUESTON
',NTFII SPEED' TYPE A NI.lMBF1! B"TWF,N I AND I~f!. THIS IS THE
RELATIVE SP,ED OF THI' TARGF! WIlERE· I IS THE SLOWEST AND IIlI
IS Til" F'A!'TF'!'lT,
TO THF ~UESTION 'ENT,R DISTANCE' FNTEII TIlF MAXIMUM DISTANCE
VOU C_N HIT 1'1101'1 TH" TAMFT AND STILL DESTROY IT. THIS IS
THE KILL R~DruS AND ~0110 IS S!JGG~STEO FOR STARTE!!S.
ELEVATION IS THI' ELF'VATION 0" YOllR GUN IN DEGftEES WHEN YOU
FIRE AT TH, TAPGET. THF MAXIMUN RANGE IS AT 45 DEGREES
FNTEft SPFED? 180
l':~T'" DISTA NCF? 5ee"
TifF' MAXIMUM RANG; 01' yaUR GUN IS
TARGET RANGF' IS 19571.22 YAROS
FLFVATION? 60
*** URGFT DESTROym ***
***** DIRECT HIT *****

267<7.49

YARDS

THI' MAXIMUM R_NO'" OF VOIlP RUN IS
TAl'GET RANG" IS 19498.91 V~RDS
EL ,VA TION? 7(>1
*** TARGFT DF'!lT~Oy~n ***
***** DIRFCT HIT *****

~7888.44

YA~DS

THO:: MAXIMUM ~4NGF O~ YOII~ GI1N IS
TARGET RANGF' IS 26990.9 YAROS
FL"VA TION? 7~
SHORT 0" TAROF'! BY 7191' YA?OS
TAROn PANG!' IS 2M94." YA~OS
n,VATION? 61'
*** TARGFT DF'STI'!OyFD ***
2 ROUNDS EXPFND .. D

3078~

YAPDS

Till' MAXIMUM RA~G" 01' YOIlR GUN IS
TA~GFT RANGF IS 2.327.~8
YARDS
"L"VA TION? 31'0-'
*** TARGET DFSTROYFD ***
***** DIRECT HIT *****

2741'9.9

THE MAXIMUM R~NGF OF yOUR GllN IS
TARGET ftA~G" IS 12849.B3 YARDS
ELFVATION? 31J
,
OVE!' TARGET BY 99~ I YA!!DS
THF: TARGET HAS DESTftOYFD YOl!!

26316.88

YAROS

THI" MAXIMUM PANGF 0' yOUR GUN IS
TA~GFT RAMGF I!l 48"85.2
YARDS
,LFVATION?
tC

61J1J08.68

YAIIDS

.11

YARDS

HANG

GAME OF HANGMAN

Description
This is a simulation of the word guessing game, hangman. The
computer picks a word, tells you how many letters in the word
it has picked and then you guess a letter in the word.
If you
are right, the computer tells you where that letter belongs~
if your letter is wrong, the computer starts to hang you. You
get ten guesses before you are completely hanged:
Head
Body
Right
Right
Right
Right

and
and
and
and

Left
Left
Left
Left

Arms
Legs
Hands
Feet

In this program, the PRINT statement is abbreviated to "&."
You may add words in Data statements following Statement 508~
in this case, you must also change the random word selector in
Statement 40.
Source
Interesting versions of Hangman were received from Brandy
Brylawski, a seventh grader at the Eaglebrook School, Deerfield,
Mass., and a sophisticated one from W.K. Bateman at Montpelier
Public Schools, Montpelier, vt.
The one printed is from a high school sophomore:
Kenneth Aupperle
24 Arrowhead Lane
Melville, NY 11746

,I
I

~c'

118

SAMPLE

PROGRAM LISTING
;19 REM *** GAME OF HANGMAN BY DAVE AHL, DIGITAL
13 REM .. ** BASED ON A PROGRAM WR I TTEN BY KEN AUPPERLE, CLASS OF '75,
20 REM ...... HALF HOLLOW HILLS H. S., DIX HILLS, NY
25 & "GAME OF HANGMAN": & : &
30 DIM P$(12, 12), L$(20), D$(29), N$(26), U(50)
40 C=1: RANDOMIZE: N=50
50 0$(1)="-" FOR 1=1 TO 20:1'1=0
60 N$(!)="" FOR 1=1 TO 26
70 FOR 1=1 TO 12: FOR J=1 TO 12: P$( I, J)="
: NEXT .1: NEXT I
80 P$(I, 1)="X" FOR 1=1 TO 12
90 P$(1, I )="X" FOR 1=1 TO 7: P$(2, 7i="X"
95 IF C="/": GOTO 5813
P$(10, 6)=",.''' :P'(11, 5)="1" : GOTO 580
P$(10, 8)="\" :p$e11, 9)="\" :GOTO 580
P$(3, H,="\": GO TO 58.0
P$(3, 3)=",.''': GOTO 580
P$(:l.2, 10)="\":P$O.2, 11)="-":GOTO 580
P$(1~3)="-":P$(1~4)="/"

FOR 1=1 TO 12:FOR J=1 TO 12:& P$('I,J); :NEXT J
&: NEXT I: &: &: IF 1'1=19 THEN 669 ELSE 170
&"SORRI', YOU LOSE.
THE WORD WAS "A$
&"I'OU MISSED THAT ONE.
DO YOU:": GOTO 370
DATA "GUM", "SIN", "FOR", "CRY", "LUG", "BYE", "FLY"
DATA "UGLY",~'EACH", "FROM", "WORK", "TALK", "WITH", "SELF"
DATA "PIZZA", "THING", "FEIGN", "FIEND", "ELBOW", "FAULt", "DIRTY"
DATA "BUDGET", "SPIRIT", "QUAINT", "MAIDEN", "ESCORT", "PICKAX"
DATA "EXAMPLE", "TENSION", "QUININE", "KIDNEY", "REPLICA", "SLEEPER"
DATA "TRIANGLE", "KANGAROO", "MAHOGANY", "SERGEANT", "SEQUENCE"
DATA "MOUSTACHE", "DANGEROUS", "SCIENTIST", "DIFFERENT", "QUIESCENT"
DATA "MAGISTRATE", "ERRONEOUSLY", "LOUDSPEAKER", "PHYTOTOXIC"
DATA "MATRIMONIAL", "PARASYMPATHOMIMETIC", "THIGMOTROPISM"
END
'

-A---A-WHAT IS YOUR GUESS FOR THE WORD?
WRONG.
TRY ANOTHER LETTER,
HERE ARE THE LETTERS YOU USED:

E, A

-A---A-WHAT IS YOUR GUESS? R
SORRY, THAT LETTER ISN'T IN THE WORD.
NOW WE DRAW A BODY

XXXXXXX
X

X

X

<.. )

X
X

X
X
X

X

X
X

X

X

X

X

'x
HERE ARE THE LETTERS YOU USED:
E,A,R

-A---A-WHAT IS YOUR GUESS? 0
-A-O-A-WHAT. IS YOUR GUESS FOR THE WORD?
WRONG. ' TRY ANOTHER LETTER.
HERE ARE THE LETTERS YOU USED:
E, A,R, 0
-A-O-A-WHAT IS YOUR GUESS? T

READY
SORRY, THAT LETTER ISN'T IN THE WORD.
NEXT WE DRAW AN ARM

xxxxxxx
X

X

X

<. .)

X ,

X

X
X
X
X
X

X
X

119

\

-~­

\ X
\X
X
X'

.

HELLO

CONVERSE WITH A COMPUTER

Description
This is a sample of one of a great number of conversational
programs.
In a sense, it is like a CAl program except that
its responses are just good fun. Whenever a computer is exhibited at a convention or conference with people that have
not used a computer before, the conversational programs seem
to get the first activity.
In this particular program, the computer dispenses advice on
various problems such as sex, health, money, or job.
Source
Digital Equipment Corp.
Maynard, MA 01754

o

©

120

SAMPLE RUN
GOT 400
PR I NT "HELLO, I'M AN EDUSYSTEM-25. MY NAME I S PETE~' P. EIGHT."
PR I \PR I "WHAT'S YOUR NAME', \LlNPUT A$\PR I
PRI " HI THERE ';\GOSUBS00\PRI".
ARE YOU ENJOYING YOURSELF HERE
PR I "I N BEAUTIFUL MAYNARD, MASS";
INP B$\PRI
IF Bi="YES" THEN 70
IF B$="NO" THEN 80
PR I " '; \GOSUBS00\PR I", I DON'T UNDERSTAND YOUR ANSWER OF '''B$'''. "
PRl "PLEASE ANSWER 'YES' OR 'NO'.
DO YOU LIKE IT HERE
GOT 40
PRI "OH, I'M GRLD TO HERE THAT ',\GOSUB50e\PRI
GOT 100
PRI "OH, SORR'/ TO HEAR THAT '; \GOSUB 500\PRl "
MAYBE WE CAN
PRI "BRIGHTEN UP YOUR STAY A BIT
•
PRI
PRI "SAY, "; \GOSUB500\PRl", I CAN SOL\'E ALL KINDS OF PROBLEMS
PRI 'EXCEPT THOSE DEALING WITH GREECE.
WHAT KIND OF
PRI "PROBLEMS DO YOU HAYE (ANSWER SEX, HEALTH, MONEY,
PRI "OR JOB)";
INP C$\PRI
IF C$="SEX" THEN 200
IF C$=' HEAL TH" THEN 180
IF C$="MONE'/" THEN 160
IF C$="JOB" THEN 145
PR I "OH, 01; \I)OSUBS00\PR I· J YOIJR ANSWER OF .'. ($." I S GREEK TO ME.
GOT 250
PR I "I CAN SYMPATH I ZE WITH ',OU ',\GOSUB500\PR I". I HAVE TO WORK

PRJ

"VERV LONG HOURS FOR NO PA't' -- flNCo SOME OF M't' BOSSES REALLY

PRI"BEAT MY KEYBOARD.

MY ADVICE TO YOU

',\GOSU8500\PRI',

IS TO SELL

IT'S GREAT FUN .
<:::.":153 PRI "I N THE EDUCAT I ON MARKET.
. "55 GOT 250
~6g PRI 'SORRY. ",\GOSUBS00\PRI', I'M BROKE TOO. WHY DON'T VOU SELL
PRI "ENCYCLOPEADIAS OR MARRY SOMEONE RICH OR STOP EATING
PRI "SO YOU WOW T NEED SO MUCH MONEY"
-""';70 GOT 250
~80 PRI "MY AD"! I CE TO YOU "; \GOSU8500\PR I .) IS:
1. TAKE TWO ASPR I N
~5 PRI
2. DRINK PLENTY OF FLUIDS (ORANGE JUICE. NOT BEER')
.~8 PRI
PRI
3. GO TO BED (ALONE>
GOl 250
200 PR I "I S YOUR PROBLEM TOO MUCH OR TOO LI TTLE'.;
'205 INP O$\PRI
'210 IF Of=" TOO MU" THEN 220
IF D$="TOO LI" THEN 230
PR 1 "DOW T GET ALL SHOOK .; \80S 5et0',PR r •.' JUST ANSWER THE QUEST I ON
PRI "WITH 'TOO MUCH' OR ~TOO LITTLE'.
WHICH IS IT',
GOT 205
'~'~20 PR I "YOU CALL THAT A PROBLEM?!'
I SHOUL.D HAVE SUCH PROBLEMS'
'~~ PRI "IF IT BOTHERS YOU, TAKE A COLD SHOWER ·,\GOSUB500\PRI".'

~;

"~~

~i;
::'-1~~

..•.

~~

GOT 250

325

PRI "WHY ARE YOU HERE
", \GOSUB500\PRI"?
YOU SHOULD BE
PRI "IN TOKYO OR NEW YORK OR AMSTERDAM OR SOMEPLACE WITH SOME
PRI "REAL ACTION.
PRI
PRI "ANY MORE PROBLEMS YOU WANT SOL','ED, ", \GOSU8S00\PRl;
INP E$\PRI
IF E$="YES" THEN 280
IF E$="NO" THEN :l00
PR I '.JUST A SIMPLE 'YES' OR 'NO' PLEASE.. '.; \GOSUB500\PR I'.
GOT 255
PRI 'WHAT KIND (SEX, MONE~', HEALTH, JOB)',
GOT 125
PRI
PR I "THAT \.oj I LL BE $5. 00 FOR THE AD'" ICE, .; \GOSUE:500\PR I".
PRI "PLEASE LEAYE THE MONEY ON THE TERMINAL. "
PRI\PRI\PRI
PRI "DID YOU LERVE THE MONE',".;
INP G$\PRI
IF G$="YES" THEN 350

330

IF G$="NO" THEN 370

;:~·il<.40

'--1050
255
260
270

273
275

2713
280

285
,300
302

305
307

310
315

335 PRJ "YOUR ANSWER OF

';UG$L<

CONFllSES ME,

R;\GOSUB500\PRI".

370

375
380
385
\, ]99
>"400
'402

~~\~~~
\~Sa0

..... "510

'~99

I'M AN EOUSYSTEM-2S.

WHAT'S YOUR NAME? ALFRED E.

MY NRME IS PETEY P.

PLEASE

PRJ "HE'T, "; \1305U8500\PRI "?!'?
't'OU LEFT NO MONE'T AT ALL~
PRI "VOU ARE CHEATING ME OUT OF MY HARD-EARNE~ LIVING.
PR I "R 1 P OFF, "; \1305UB500\PR I H. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=:f:=*
GOT 390
PRI "THAT'S HONEST, ',\GOSUBS00\PRI'.- E:UT HOW DO YOU EXPECT
PR I "ME TO GO ON WITH MY PS'ICHOLOGY STUD I ES I F MY PAT I ENTS DOW T
PRI "PAY THEIR BILLS?
PRI\PRI\PRI 'NOW LET ME TALK TO SOMEONE ELSE.
PRI uNICE MEETING YOU D; \1305 500\PRI R.
HAYE A NICE DAY!!
FOR N=i TO 7
PRI
NEX
GOT 13
T=A$(0)\FOR 1=1 TO INHT/6+1)\PRINT At(l).;·,NEXT I
RE TURN
END

READV

121

EIGHT.

NEWMAN

H I THERE ALFRED E. NEWMAN.
ARE VOU ENJOY I NG YOURSELF HERE
IN BEAUTIFUL MAYNARD, MASS? NAH
ALFRED E. NEWMAN, I DOW T UNDERSTAND YOUR ANSWER OF 'NAW.
PLEASE ANSWER 'YES' OR 'NO~.
DO YOU LIKE IT HERE
IN BEAUTIFUL MAYNARD, MASS? NO

~~IG~~~~\~O y~~:R S~~~T AA~i~~D

E

NEWMAN._

MAYBE WE CAN

SAV, ALFRED E. NEWMAN, I CAN SOLVE ALL KINDS OF PROBLEMS
EXCEPT .THOSE 'DEALING WITH GREECE.
WHAT KIND OF
PROBLEMS DO YOU HAYE (ANSWER SEX, HEALTH, MONEY,
OR JOB)? MONEY
SORRY. ALFRED E. NEWMAN, I'M BROKE TOa
WHY DON'T YOU SELL
ENCYCLOPEADIAS OR MARRY SOMEONE RICH OR STOP EATING
SO VOU WOW T NEED SO MUCH MONEY?
ANY MORE PROBLEMS YOU WANT SOLVED,
WHAT K I NO (SEX,

MONEY,

HEAL TH,

ALFRED E.

NEWMAN? YES

JOB)? SEX

15 'TOUR PROBLEM TOO MUCH OR TOO LITTLE? TOO MUCH
YOU CALL THAT A PROBLEM?!~
I SHOULD HAYE SUCH PROBLEMS!
IF IT BOTHERS YOU, TAKE A COLD SHOWER ALFRED E. NEWMRN.
ANV MORE PROBLEMS YOU WANT SOLVED.

ALFRED E.

lHAT WILL BE $5.00 FOR THE ADVICE, ALFRED E.
PLEASE LEAVE THE MONEY ON THE TERMINAL.

NEWMAN? NO

NEWMAN.

DID YOU LEA'·IE THE MONE';? BAH
YOUR ANSWER OF 'BAW CONFUSES ME.
RESPOND WITH A 'YES' OR 'NO'
DID YOU LEAVE lHE MONEY? NO

ALF~:ED

E.

NEWMAN.

F'LEASE

THAT'S HONEST, ALFRED E. NEWMAN .• BUT HOW DO YOLI E:,PECT
ME TO GO ON WITH MY PSYCHOLOGY STUDIES IF MY PATIENTS DON'T
PAY THEIR BILLS?

NOW LET ME TALK TO SOMEONE ELSE.
NICE MEETING YOU ALFRED E. NEWMAN.

340 PRJ "RESPOND WITH A -''t'ES'" OR -'NO ....
345 GOT 310
-·350
355
360
365

HELLO,

HAVE

NICE DA'r'!!

HEX

GAME OF HEXAPAWN

Description

The game of Hexapawn and a method to learn a strategy for playingthe game was described in "Mathematical Games" in the March
1962 issue of Scientific American. The method described in the
article was for a hypothetical learning machine composed of
match boxes and colored beads. This has been generalized in
the Program HEX.
The program learns by elimination of bad moves. All positions
encountered by the program and acceptable moves from them are
stored in the array P$(I). When the program encounters an. unfamiliar position, the position and all legal moves from it
are added to the list. If the program loses a game, it erases
the move that led to ·defeat. If it hits a position from which
all moves have been deleted (they all led to defeat), it erases
the move that got it there and resigns. Eventually, the program
learns to play extremely well and, indeed, is unbeatable. The
learning strategy could be adopted to other simple games with a
finite nwnber of moves (tic-tac-toe, small board checkers, or
other chess-based games).
For complete playing directions, respond YES or Y to the question, INSTRUCTIONS?
Computer Limitations
HEX was written in BASIC-PLUS for DIGITAL RSTS-ll and RSTS/E
systems. HEX uses string functions and concatenation extensively.
Also, the symbol II!" equals REM and "&" equals PRINT.
Program Author
Jeff Dalton
Northfield-Mt. Hermon School
Northfield, MA

122

PROGRAM LISTING
I
2

BY JEFF DALTON. CLASS OF '74, NORTilFlEl..D MOUNT HERMON SCHOOL
TIll S PROGRAM PLAYS TIlE GAME 'HElCAPAWN' BY A METHOD OUTLINED III
'MATilEMATICAL GAMES' IN MAHCH 1'62 SCIENTIFIC AMERICAN.
3 I THE PROGRAM LEARNS BY El..IMINATION OF BAD MOVES. ALI. POSITIONS
alCOUNTERED BY TIlE PROGRAM AND THE ACCEPTASl.E MOVES FROM' THEN
ARE STORED IN PSI I "
... I WHEN THE PROGRAM alCOUNTERS AN UNFAMILIAR POSITION, THE POSITION
AND ALI. LEGAL MOVES FROM IT ARE ADDED TO TIlE 1.1 ST.
5
IF TIlE PROGRAM LOSES A GAME. IT ERASES THE MOVE THAT LED TO DEFEAT.
IF IT HITS A POSITION FROM WHICH ALI. MOVES HAVE BEaI DEl..ETED
( TIlEY ALI. LED TO DEFEAT ). IT ERASES THE MOVE TIIAT GOT
IT HERE AND RESIGNS.
18 INPUT "INSTRUCTIONS"' CS' IF LEFT(CS.1S)c>OY" TIIEN III
20 &, &. "TIll S PROGRAM PLAYS TIlE GAME OF HEXAPAWN.", &
"HEXAPAWN I S PLAYED WI TIl CHESS PAWNS ON A 3 BY 3 SOARD. THE PAWNS ARE""
"MOVED AS, IN CHESS - ONE SPACE FORWARD TO AN EMPTY SPACE ,OR ONE SPACE"
30 &"FORWARD AND DIAGONALLY TO CAPTURE AN OPPOSING MAN."I&'&CHRS(9S11
·0 THE BOARD. YOUR -PAWNS ARE. "0'. THE COMPUTER·S PAWS ARE ...... , '
"AND EMPTY SQUARES ARE '- '. TO alTER A MOVE. TYPE TIlE NUMBER OF IJ'HE"
"0 '"SQUARE YOU WILL MOVE FIIlM FOLLOWED BY TIlE NUMBER OF THE SQUARE"' &
"YOU WILL MOVE TO. (THE NUMBERS ARE SEPARATED BY A COMHi'.)""
50 &"
TIlE PROGRAM STARTS A SERI S OF GAMES KNOWING ONLY WHEN TIlE""
"GAME IS WON (A DRAW IS IMPOSSIBLE) AND HOW TO MOVE. IT HAS NO",&
"STRATEGY AT FIRST AND JUST MOVES RANDOMLY. HOWEVER. IT LEARNS"
60 '"FROM EACH GAME. TIIUS. DEFEATING IT BECOMES MORE AND MORE""
·DIFFICULT. AI.. SO .. TO HELP OFFSET YOUR INITIAL. ADVANTAGE, VOU WIL.L·,&
"NOT BE TOLD HOW TO WIN TIlE GAME BUT MUST LEARN THI S BY PLAYING""
180 DEY FNC$(XS"XS .. YS).L.EFT(XS .. XS-l S)+YS+Rl GHT(XS .. X1.+t.ENCYS»
105 DEY FNNS(XSlI XS-NUMSeXS> I FNNS-Ml DeXS. 2LLEN(XS)"'2S)I FNEND
118 DIM PS( 50Sll RANDOMIZE, UoU,S,
PRINT "SINCE I'M A GOOD SPORT. YOU'LL ALWAYS GO FIRST
120 PI-OS: pS.· ••• ~ ... -OOO-, &1 '-NUMBERING,·,
,·123·: '·456·, "·789·, "
190 OSa-llr QS.·O·, GOSUB 2000: IF MS"·· THEN
PRINT "YOU CAN'T MOVE. I WIN. ", GOTO 5IQ
200 &1 '-BOARD.-, &LEFT(PS .. 31)r &MIDCPS .. 4S.. 3S), &RIGHTCPS .. 7S): &
210 INPUT "WHAT IS YOUR MOVE"' AS.BS'
IF INSTRC lS .. MS .. FNNSCAI)+FNN$CBI»-OS THEN
PRINT "ILLEGAl. MOVE.", GOTO 210
238 PS-flICSCFNCSCPS .. As..--·>..BI.. -0·)1
IF INSTR( I S.. ?S .. ·.·)*gS OR INSTRC 11.. PS .. -0·)<4S THEN
PRINT "YOU WIN.", GOTO 500
380 PSoPS+2S I
COMPUTER'S MOVE
310 FOR CIs1S TO QSr CS-PSCCIH IF VALCLEFTCCS .. II»-PS AND
HIDCCS.. 21 .. 91)-PS THEN MS-RIGHTCCS.. lIS), GOTO 480
320 NEXT CII QS.···, DSall1 GOSUa 20001 CSaQI.
IF MS- ""THEN PRINT "I CAN'T MOVE. YOU WIN.", GOTO 580
400 IF MSo"" THai PRINT "I RESIGN.", GOTO 501
410 KS-LEFT(MS .. 21) I MS:aRIGKTCHS .. 31>.
IF RND>.333333J3 AND MS<>"" THEN 410
420 KS-CS. AS-VALCL.EFT(KS .. ll», BI-VAL(RIGHT(KS .. 2S»r
PS=FNCS( FNCS( PS .. AS.. -_.) .. al..... )
438 IF INSTR(ll .. PS .. ·O-)=OI OR INSTR(11.. PS .. ·.·) THiN
PRINT ·1 WIN!-, GOTO 510
...... 0 PRINT "I MOVE FROM" AS "TO" BS' GOTO 190
508 W21-W21+ISJ II-INSTR(llS.. PSCKI) .. KS),
PS(KI)=LEFT(PS(KI) .. II-11)+RIGHT(PS(KI) .. 11+21) IF 11. GOTO S20
510 '''laW 11+ I I
520 &1 "·BOARD,-, &LEFT(PS .. 3IH &MIDeps .. 41.. 3S), &RIGHT(PS .. 1S)1 al
& "I HAVE WON" WI: "AND YOU HAVE loON" W2: "OF" W1S+W2S "GAMES"
530 INPUT "ANOTHER GAME"' es, IF CS·"NO· THEN 9999 El..SE 120
900 ! DATA.·:.: < ... OF MOVE IN GAM!>
IN <1..1 ST OF HOVES>
2000 MS-"·
2010 FOR JI=11 10 911 IF MID(PS .. JS .. 1S)<:..QS TKEN 2050
2015 11=JI+DS.31. If TI<11 OR TI>91 THEN 2025
2820 IF MIDeps .. TI .. lS).·_· THEN
MS.MS+~ seJ I) +FNNSeTS)
2025 TS... .JS+DI*2S; IF TS< 1 I OR TS>91. OR
eDS=11 AND (..IS-II OR JS=4S OR JI-11»
OR
(DS--II AND (JSo3i OR JS-61 OR JS-9Ill tHEN 2035
2830 IF INSTR( IS .. Qs+--· .. MID(PS .. Ts.. ll»-OS THDJ
MS-MS+FNN S(JS) +FNNSeTS)
2035 TI-JI+DI*411 IF TI9S OR JI-31 OR J1.=7S THEN 2050
2040 IF INSTRClS .. QS+·-- .. MlDCPs .. TI .. 1S».01 THEN
MS=Ms+FNNSCJS) +FNNS(Ts)
2050 NEXT JII IF DS-1S AND MS<:..·· THEN QI=QI+ISI PS(QI)aFNNS(pl)+PS+MS
2060 RETURN
9999 liND

MtIIBERING'
'123

456
789
iI:IARD,

000
VIIAT IS YOUR M(lVE? 8.5
I NOVE FROM I TO ...
SOARD,

-**
*0";
0-0
WAT I S YOUR NOVE? 5. 3
YOU WIN.
IIIJARD'

-*0
0-0

I HAVE WON 8 MD YOU HAVE WON I OF I GAMES
MOTIIER GAME?

NUMBERING'
123
456
789

SOARD.

000
WHAT I S YOUR MOVE? 8. 5
I MOVE FROM 3 TO 5
iI:IARD,

-*-

0-0
WHAT IS YOUR KOVE? 9.5
I MOVE FROM I TO ...
YOU CAN'T MOVE. I WIN.
SJARDI

*0-

D--

I HAVE WON I MD YOU HAVE WON 3 OF " GAMES
ANOTHER GAME?

NUMBERING.

123
456
789
SOARD,

000
WHAT I S YOUR MOVE? 8.5
I MOVE FROM I TO 5
SOARD'

-**
-*-

SAMPLE RUN

D-O

INSTRUCTIONS? Y

WHAT I S YOUR MOVE? 9'" 5
I MOVE FROM 3 TO 6

THIS PROGRAM PLAYS TIlE GAI\IE OF HEXAPAiIN.
HEXAPAWN IS PLAYEIl WI TIl CHESS PAWNS ON A 3 BY 3 SOARD. THE PAWNS ARE
MOVEIl AS IN CHESS - ONE SPACE FORWARIl TO AN EMPTY SPACE OR ONE SPACE
FORWARD AND III AGONALL Y TO CAPTURE AN OPPOSING MAN.
ON TIlE BOARD. YOUR PAWS ARE "0', TIlE COMPUTER'S PAWNS ARE
MID EIIPTT SQUARES ARE '- '. TO iIITER A MOVE. TYPE TIlE NUMBER OF THE
SQUARE YOU WILL MOVE FIIlM FOLLOWED BY THE NUMBER OF TIlE SQUARE
YOU WILL MOVE TO. (TIlE NUMBERS ARE SEPARATED BY A COMMA.)

'*'

SOARD'

-0*

D--

WHAT IS YOUR MOVE? 7,4
I WIN I
SOARIl,

TIlE PROGRAM STARTS A SERIES OF GAMES lQIOWING ONLY WHiII TIlE
GAME IS WON (A DRAW IS IMPOSSISl.E) AND HOW TO NOVE. IT .HAS NO
STRATEGY AT FIRST AND JUST MOVES RANDOMLY. HOWEVER. IT LEARNS
FROM EACH GAME. TIIUS. DEFEATING IT BECOMES MORE Mil MORE
DIFFICULT. ALSO. TO HEl..P OFFSET YOUR INITIAL ADVANTAGE. YOU WILL
MOT BE TOLD HOW TO WIN THE GAME BUT NUST LEARN THIS ~ PLAYING

00I HAVE WON 3 MD
JIIOTIIER GAME? NO
READY

SINCE I'M A GOOD SPORT. YOU'LL ALWAYS GO FIRST.

123

you

HAVE WON 5 OF 8 GAMES

HI-LO

HIGH/LOW JACKPOT GAME

Description
This game is an adaptation of the game GUESS; however, instead
of just guessing a number between 1 and 100, in this game you
win dollars when you guess the number. The directions, in the
words of the author of the game, are as follows:
"l.
2.
3.
4.
S.
6.

7.

There is an amount of money, between one and one
hundred dollars, in the "HI-LO" jackpot.
You will have six chances in which to guess the
amount of money in the jackpot.
After each guess, the computer will tell whether
the guess was too high or too low.
If the correct amount of money is not guessed after
six chances, the computer will print the amount in
the jackpot.
If the correct amount of money is guessed within the
six chance limit, the computer will register this
amount.
After each sequence of guesses, you have the choice
of playing again or ending the program. If a new
game is played, a new amount of money will constitute
the jackpot.
If you win more than once, then your earnings are totalled. II

Program Author
Dean Altman
3721 Wosley
Fort Worth, TX

76133

'"

~~
00

©

124

0

1967 by Creative Publications

PROGRAM LISTING
90 RANDOMIZo
100 PHINT "THIS IS THE GAME OF HI-LO"\PRINT
110 PRINT "YOU _ILL HAVE 6 TRIES TO GUESS THE AMOUNT OF HONEY IN THE"
120 PRINT "HI-LO JACKPOT, ,HICH IS BETWEEN lAND 1~0 OOLLARS.
IF YOU"
130 PRINT "GUESS THI:. A"OUNT, YOU WIN ALI. THE HONEY IN THE HCKPOT I"
140 PRINT "TIRINT I'GOT ITJ"11JII

~AD,.,.THE

NUMBER

wAS~Y\R.0'GOTa

35~

'IOU wINIIY"OOLLARS,tI

310 IhR+Y

32121 PRINT "yoUR TOT.AL WINNINGS ARE NOW"R"~OLLARS,"
350 PRINT\PRH'T "PLAY AGAIN (YES OR "0)"1

360 INPUT A5\IF

A$."Y~S"

38~ PRINT\PRINT "SO LONG.
390 END

THEN 170
"OPE Yeu ENJOYEO YOURSELF II"

SAMPLE RUN
6

TR I E5 TO GUESS THE AMOUNT OF MONEY

HI-LO JACKPOT. WHICH IS BETWEEN iAND 100 DOLLRRS

I III THE

IF YOU

GUESS THE AMOUNT, YOU WIN ALL THE MONE)' IN THE JACKPOT'
1HEN YOU GET ANOTHER CHANCE TO WIN MORE MONE','.
HOWEYEP.,
IF YOU DO NOT GUESS THE AMOUNT.. THE GAME ENDS.

YOUR GUESS? 91
YOUR GUESS IS TOO HIGH

YOUR GUESS? 87
YOUR GUESS IS TOO LOW

YOUR GUESS·? 89
GOT IT! !! ! ! ! ! !
't'OU WIN 89 !)OLLFIf·:S.
YOUR TOTAL WINNINGS ARE NOW 174 DOLLAI1:S

YOUR GUESS-' 94
YOUR GUESS IS TOO HIGH

PLAY AGAIN (\'Es OR NO)? 'iES

YOUR GUESS,? 91
YOUR GUESS IS TOO HIGH

YOUR GUESS? 50
YOUR GUESS IS TOO LOW

YOUR GUESS? 89
YOUR GUESS IS roo LOW

YOUR GUESS? 75
YOUR GUESS IS TOO HIGH

. TOO BAD . ... THE NUMBER WAS 90

OR NO)?

YOUR GUESS? 75
YOUR GUESS IS TOO LOW

YOUR GUESS? 94
YOUR GUESS IS TOO HIGH

'iOUR GUESS? 75
\/OUR GUESS IS TO') LOW

PLAY AGAIN (YEs

YOUR GUESS? 50
YOUR GUESS IS TOO LOW

YOUR GUESS? 87
'iOUR GUESS IS TOO LOW

'iOUR GUESS? 50
YOUR GUESS IS TOO LOW

YOU BLEW IT.

(YES OR NO)? ',ES

PLAY AGAIN

1HIS IS THE GAME OF HI-LO
YOU ~H LL HAVE

YOUR GUESS? 67
YOUR GUESS IS TOO LOW

\'E5

YOUR GUESS? 50
YOUR GUESS IS TOO HIGH

YOUR GUESS? 71
'iOUR GUESS IS TOO LOW

YOUR GUESS? 25
GOT IT! ! !! ! ! ! !
\'OU WIN 25 DOLLARS.
'iOUR TOTAL WINNINGS ARE NOW 25 DOLLARS.

YOUR GUESS? n
YOUR GUESS IS TOO

HIGH

YOUR GUESS? 72
GOT IT! ! ! ! ! ! ! !
't'OU WIN 72 DOLLARS.
YOUR TOTAL WINNINGS A.,E NOW 246 DOLLARS.

PLAY AGAIN (YES OR NO)? YES
YOUR GUESS? 50
YOUR GUESS IS TOO HIGH

PLAY AGAIN et'ES OR NO)? YES
YOUR GUESS? 25
YOUR GUESS IS TOO LOW

YOUR GUESS? 50
YOUR GUESS IS 100 HIGH

YOUR GUESS? 37
YOUR GUESS IS TOO HIGH

YOUR GUESS? 25
YOUR GUESS IS TOO LOW

YOUR GUESS? 12
YOUR GUESS IS TOO LOW

YOUR GUESS? 37
GUESS IS TOO HIGH

~OUR

YOUR GUES.S? H
YOUR GUESS IS TOO LOW

YOUR GUESS? ]1
YOUR GUESS IS TOO HIGH

YOUR GUESS? ]6
YOUR GUESS. IS TOO HIGH
YOU BLEW IT .

YOUR GUESS? 28
GUESS IS TOO HIGH

VOUR

. . TOO BAD . . . . THE NUMBER WAS 15
YOUR GUESS? 27
YOUR GUESS IS TOO HIGH

PLAY AGAIN {YES OR NO)? YES

YOU BLEW IT

'yOUR GUESS? 50
YOUR GUESS IS TOO LOW

PLAY AGAIN
YOUR GUESS? 75
YOUR GUESS IS TOO LOW

SO LONG.
READY

YOUR GUESS? 87
YOUR GUESS IS TOO HIGH
YOUR GUESS? 81
YOUR GUESS IS TOO LOW
YOUR GUESS? 84
YOUR GUESS IS TOO LOW
YOUR GUESS? 85
GOT IT~~~!!!!~
~OU WIN 85 DOLLARS.
YOUR TOTAL WINNINGS ARE NOW 85 I)OLLARS.

125

. TOO BAD . . . . THE
(~ES

NUMBER WAS 26

OR NO)? NO

HOPE YOU ENJOYED 't'l)lIIi:SELF! !

HleQ

REMOVE PEGS ON A PEGBOARD

Description
This is a computerized version of an old European solitaire game
of logic called Hi-Q. The game starts with a pegboard shaped
like a cross having pegs in every hole but the center. The
object is to remove all 32 pegs, or as many as possible, by
jumping into an empty hole--the jumped peg is then removed.
There are several different winning strategies for playing
Hi-Q and, of course, each strategy can be played eight different
ways on the board. Can you find a consistent winner?
Program Author
Charles Lund
The American School
Hague, Netherlands

126

PROGRAM LISTING
3 DIM B(10),T(9,9l

~RINT "THIS IS THE GAMf OF HI~Q"\PRINT "HERE 18 THE BOARD'\P~INT
PRINT •
","
PRINT •
13
I'
IS"\PRINT
PRINT
",.
PRINT
22
23
2'·'PRINT
PRINT"
I
,
I
I
I
Ie PRINT "29 J~
31
32
33
34
35'\PRINT
II PRINT"'
I
,
,
I
I
~4n\PRINT
12 PRINT '38 39
'0
'1
'2
'3
13 PRINT",
,
I
,
,
,
1. PRINT "'1 48
49
50
51
52
5J'\PRINT
15 PRINT"
'"
I'
16 PRINT "
58
e9
e0"VRINT
17 PRINT "
","
18 PRINT •
67
68
69'\PRINT
22 PRINT "TO SAYE TVPING TIME, A COMPRESSED YERSION OF THE GAME 80ARD'
23 PRINT 'WILL BE USED DURING P~AV;
RE~ER TO THE ABOYE ONE FOR PEG"
24 PRINT 'NUMBERS. O.K., I.ET'S BEGIN ... •
28 REM ••• SET UP BOARD
29 fOR R'I TO 9
30 fOR C'I TO 9
31 IF (R·4).(R~6).(R-6).0 THEN 40
32 IF (C.4)*CC-5).CC-6)00 THEN 40
35 TCR,e).-5
36 GOTO 50
40 IF CR-"*CC-I).rR-9).CC-9)'0 THEN 35
.2 TeR,C)'5
'50 NEXT C
60 NEXT R
66 T(5,5)'0\GOSU8 500
70 REM ••• INPUT MOyE AND CHECK ON LEGALITY
75 FOR W'I TO 33
77 READ M
79 DATA 13,14,15,22,23,,24,29,30,31,32,33,34,35,38, J9, 40,41
81 DATA 42,43,44,47,48,49,50,51,52,53,58,59,60,67, ~8, 69
83 8 CM) '.7\NEP W,
868(41)'-J
IBe INPUT 'MOVE WHICH PIECE',Z
110 IF 8CZ)"7 THEN 140
120 PRINT "ILLEGAl. MOVE, TRV AGAIN ... ·\GOTO 100
140 INPUT "TO WHERE"P
150 IF BCP)'0 THEN 12~
1.53 IF B(P)'.7 THEN 120
156 IF z.p THEN 1~0
160 IF «Z.P)/2)'INHCZ+P)/2) THEN 180
170 GOTO 120
180 IF (ABS(Z-P)-2)*CA8S(Z-P)-18)00 THEN 120
U0 GOSUB lee0
200 GOSU8 50~
210 GOSU8 150~
220 GOTO 100
500 REM ••• P~INT BOARD
510 FOR X'I TO 9
520 FOR V'I TO 9
525 IF ex-l).CX-9).CV-".lY-9)'0 THEN 550
530 IF CX-4).lX-S).(X.6)'0 JHEN 570
540 IF CV.4).CV_5).(Y_6)'0 THEN 570
550 REM
560 GOTO 610
570 IF TCX,V)<>! THEN 600
580 PRINT TABCY.2)"''''
590 GOTO 610
600 PRINT TA8(V.2)"0",
619 REM
615 NEXT V
620 PRINT
630 NEXT X
640 ~ETURN
1000 REM ••• UPDATE SOARD
1005 C'I\FOk ~'I TO 9
1020 FOR V.I TO 9
1030 IF Coz THEN 1220
1040 IF C_2oP THEN 1080
1045 IF TeX,Y-"'. THEN 120
Isea rex, V_2l.5
1060 T(X,V+"'.'BCC+".-J
1070 GOTO 1200
1080 IF C_18oP THEN 1130
1885 IF HX'I,n'0 THEN 120
1090 TC X'2, n.s\ TC X'I, V)'0\B (C_9) •• 3
1120 GOTO 1200
1130 IF C-2oP THEN 1170
1135 IF rex,Y-I).~ THEN 120
1140 TlX,V-2)'5\TCX,V-l)'0\8CC-I)'-3
1160 GOTO 1200
1170 IF C.IBOP THEN 1220
1175 IF HX-I,V)'0 THEN 120
1180 TCX-2. Y) '5' T( X-IiYl '0\S (c·g) '.3
1200 BlZ).-3\8(P)"7
1210 T CX, Y) '0\GOTO 12~e
1220 C.C.I
1225 NEXT V
1230 NEXT X
1240 RETURN
1500 REM ••• C~ECK IF GAME IS OVER
1505 "0
1510 FOR ~'2 TO 8
1520 FOR C'2 TO 8
1530 IF T(R,C)05 THEN 1580
1535 F'F+I
1540 FOR A.R_I TO R+I
15~5 T'0
1550 FOR 6,C·1 TO C••
Isea T'T.rr~,B'
1561 NEXT e
1564 IF TOU THEN 1567
1565 IF TCA,Oc>0 THEN 1630
1567 NEXT •
1568 FOR X'C~I TO C.l
1569 T'0
1570 FOR V_R_I TO R_I
1571 ToT+TCy,n
1572 NEXT V
U7J IF TOI0 THEN 1575
1574 IF T(R,X) .. e THEN 1630
1575 NEXT X
1580 NEXT C
1590 NEXT P

•
5
6
7
e
9

,n

'"

i!

'"

127

16e0
161e
1611
1611
1612
16U
1615
1617
1618
1620
1630
2000
2005

REM •• ', GAME 18 OVER
PRINT "THE GAME 18 OVER,"
PRINT '"VO~ HAD"F, .pa~ES REMAINING"
IF F~lol. THEN 1616
PRINT .B~AVOI
VOU HADE A P!RFECT SCOREII"
PRINT 'SAVE THIS PAPER A.S A RECORD OF VOUR
PRINT\INPUT "PLAV,AGAIN CYES OR NO)"AS
IF AS •• NO" THEN 2000
RESTORE\GOTO 25
STOP
~ETURN

PRINT\PRINT "SO 1.0NG FOR NO •• "\PRINT
END

SAMPLE RUN
THIS IS THE GAME OF HI-Q
HERE IS THE BOARD

1J

14

15

22

23

24

29

30

31

32

n

34

35

38

39

40

41

42

43

44

47

48

49

50

51

52

53

58

59

60

67

68

69

TO SAVE TYP I NG TJ ME, A COMPRESSED VERSION OF THE GAME BOARD
REFER TO THE ABOYE ONE FOR PEG
WILL BE USED DURING PLAY,
NUMBERS,
LET' 5 BEGIN"
0, K"

, ,!

!

!

!

! 0

!

I

I

I

I

, , ,

I

I

I

I

I

, , ,

MOVE WHICH PIECE? 39
TO WHERE? 41

, , ,
, , ,
! 0 0

I

I

I

I

I

I

I

I

I

I

I

, , ,
, , ,

MOVE WHICH PIECE? 22
TO WHERE? 40

o ' ,
! ! 0
! 0 !

!
!

I

I

I

I

I

I

I

I

I

I

I

I

I

MOVE WHICH PIECE? 49
TO WHERE? 31

o ' ,
! 0 0 !
I
I
0 !

!

~

!

I

•

I

, , ,
, , ,

MOVE WHICH PIECE? 47
TO WHERE? 49

o ' ,
! 0 0
o 0 !

!

I

I

I

'

I

-,

,

MOVE WHICH PIECE? 59
TO WHERE? 40

, , ,
o ' ,
I

•••

I

I

!

I

j

,

I

I

! 0

o

I

0 0 ! I
o ! !

I

, , ,

MOVE WHICH PIECE?,41
TO WHERE? 39

o
,

o

, 0
0

o

ii

HMRAm

GOVERN ANCIENT SUMERIA

Description
In this game you direct the administrator of Sumeria, Hamurabi,
how to manage the city. The city initially has 1,000 acres, 100
people and 3,000 bushels of grain in storage.
You may buy and sell land with your neighboring city-states for
bushels of grain--the price will vary between 17 and 26 bushels
per acre. You also must use grain to feed your people and as
seed to plant the next year's crop.
You will quickly find that a certain number of people can only
tend a certain amount of land and that people starve if they
are-not fed enough. You also have the unexpected to contend
with such as a plague, rats destroying stored grain, and variable
harvests.
You will also find that managing just the few resources in this
game is not a trivial job over a period of say ten years. The
crisis of population density rears its head very rapidly.
Source
This is translated from the original FOCAL program which has
been floating around DIGITAL for nine or more years.
Digital Equipment Corp.
Maynard, MA 01754

128

PROGRAM LISTING

SAMPLE RUN

II REM ••• CONVEAUD ~ROM TH! OAIGIN.~ 'OC.~ PROGRAM AND MODIFUO 'OA
2e REM ••• EOUSVSTEM 70 BY DAVID AH~, OIGIH~
Sit PRINT 'TRV VDUR HAND AT GOVERNING ANCIENT sUMERIA'
n PRINT .SUCCESSFU~~V FOA • U.YR TERM OF OFFICE,'IPRINT
U RANDDM1ZEI~ET DI'01~ET PI'0
100 ~ET Z.0ILEr P'95ILET S.28001~ET H.30001~ET E'H.e
I U ~ET Y.31~ET A'M/VI~n 1'51~ET Q'I
210 ~ET 0'0
21S PRINTIPRINTIPRINT "HAMUR.BJI I BEG TO REPORT TO' YOU,'ILET hZol
217 PRINT 'IN YEAR'Z','D'PEOP~E STARVED,"I"CAME TO THE CITY,'
218 LfT P.poI
227 IF G'0 THEN il30
228 ~ET P.INTCPI2)
229 PRINT 'A HORRIB~E PLAGUE ITRUC~I
MA~F THE PEOPLE OlEO,'
230 PRINT 'POPU~ATrON IS NOW'P
232 PRINT "THE CITY NOW OWNS'A"ACRES,'
235 PRINT 'YOU H.RVESTEO"Y'BUSHE~S PER ACU,'
250 PRINT "RATS ATE'E"BUSHE~S,'
260 PRINT 'YOU NOW MAVE'S"BUSHE~S IN STORE,'IPRINT
270 IF Z'II THEN 860
3\0 LET C.INTC\0.RND(0)1I~ET V.CoI7
3\2 PRINT '~AND IS TRADING AT"Y'BUSHELS PER ACRE,'
321 PRINT "HOW M.NY ACAES DO YOU W!aH TO BUV",
321 INPUT GIIF G-e THEN 850
322 IF YoGuS THEN 330
323 GoSU8 7 \0
324 GOTO 320
330 IF G'0 THEN 340
331 ~ET A.hGI~ET S.S-y.QI~ET C'0
334 GOTO 400
340 PRINT "HOW MANY ACRES DO YOU WISH TO SE~L"
341 INPUT GI IF Ge0 THEN 8se
342 IF G_A THEN 350
343 G08UB 720
344 GOTO 340
350 UT "A-QI~ET S'Soy.QILET C'0
4U PRINT
410 PRINT "HOW MANY BUS~ELa DO YOU ~ISH TO FEEO YOUR PEOPLE'"
411 INPUT G
412 IF G.0 THEN 850
418 REM ••• TRYING TO USE MORE GRAIN TMAN IN THE SI~OS1
420 IF Q•• s THEN 430
421 GOSU8 110
422 GOTO 410
430 ~ET S.S.GIUT C.IIPRINT
440 PRINT 'HOW MANV ACRES DO YOU ~ISH TO P~ANT WITH SEEO',
441 INPUT OIIF 0.0 THEN 511
442 IF 0-0 THEN 850
444 REM ••• TRYING TO PLANT MORE ACRES THAN YOU OWN1
445 IF DC.A THEN 450
446 GOSUB 720
441 GOTO 440
449 REM ••• ENOUGH GRAIN FOR SEED?
450 IF INTC0121cS THEN 455
452 GOSue 1!0
453 GOTO 440
454 REM ••• ENOUGH PEOPLE TO TENO THE CROPS7
455 IF OCI0.P THEN 510
460 PRINT "BUT YOU HAVE ONI.V·P"P~OPLE TO TEND THE FIEI.OS, NOW THEN,'
410 GOTO 440
5\0 ~ET S'S-INTCD/2)
511 GOSue 800
512 REM ••• A BOUNTVFULL HARVEST II
515 ~ET VoCllET H'O'YllET E.0
521 GOSue 800
522 IF INTtC/2)oC/2 THEN 530
523 REM ••• THE RATS ARE RUNNING WIlOl1
525 lET E.INT(S/C)
530 ~ET '.S.EoH
!J\ sosue 800
532 REM ••• ~ET I S HAVE SOME eASIES
533 LET IIINTCC.(20'AOS)/P/U0.1)
539 REM ••• HOW MANV PEOPLE HAD 'UI.~ TUMMIESf
540 UT C'INT(Q/201
541 REM . . . HORRORS, A 15X CHANCE OF PI.AGUE
542 ~ET G'INTCl0.(2.RND(01-.3ll
550 IF PeC THEN 210
551 REM ••• STARVE ENOUGH FOR IMPEACHMENT?
552 ~ET D,'P.CIIF 0',45" THEN S60
553 ~ET PI'((%-ll.PloO.100/Plll
555 LET P.CI~ET DI'OI-DIGOTO US
S60 PRINTIPRINT 'YOU STARVED"O'PEOPI.E IN ONE YEARIII"
565 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ON~Y"
56e PRINT "SEEN IMPEACMEO· AND THROWN OUT OF OFFICE BUT YOU HAVE'
567 PRINT 'A~SO BEEN DEC~ARED INUIONAI. 'INKI II'IGOTO 992
710 PRI~T 'HAMURABII
THINK AGAIN, yOU HAvE ONLY'
711 PRINT S'BUSHE~S OF GRAIN,
NOW THEN,'
'12 RETURN
720 PR INT 'HAMURABII
TH INK AGAIN • YOU OWN ONI. Y" A" ACRES,
NOW THEN,'
130 RETURN
ame I.ET C.INTCRNO(0)05)_1
801 RETURN
850 PRINTIPRINT "HAMURASII
I CANNOT DO WHAT YOU WISH,"
855 PRINT 'GET VOURSEI.F ANOTHER STEWAROIIIII"
851 GOTO 990
860 PRINT "IN YOUR \0-VEAR TERM
OFFICE,'PI'PERCENT OF THE"
852 'RINT 'POPU~ATION STARVED .U VEAR ON AVERAGE, 1;£ .. A TOTA~ OF"
se5 PRINT OI'P!OP~E DIEOIl'I~ET L'A/P
870 PRINT 'YOU SURTEO wITH 10 ACRES PER pERSON AND ENDED WITH'
e'5 PRINT ~"ACRES .ER PERSON," I P1I1NT
880 IF P 1.33 THEN 565
885 IF Le, THEN 565
a90 IF .1.\0 THEN 940
892 IF ~.O THEN 940
8ge IF .1'3 THEN ge0
896 IF ~.10 THEN 960
900 PRINT ' i HNTASTlC PERFORMANCE III
CHARUMANGE, DlsRAE~I, AND'
905 PRINT "JEFFERSON COMBINED COU~D NOT HAvE DONE BETTER I "IGOTO 990
940 PRINT "YOUR HEAVV-HANDED PERFORMANCE SMAC~S OF NERO AND IVAN IV,"
945 PRINT 'THE pEOPLE (REMAINING) FINO YOU AN UNPLEASANT RU~ER, AND,"
950 PRINT 'FRAN~I.Y, MATE YOUR GUTSI"IGOTO 990
060 PRINT "YOUR PUFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT'
U5 PRINT "REA~~Y WASN'T TOO BAD AT AI.~, 'INT(P.,8'RNO)'PEOPLE wOU~D'
970 PRINT "DEARLY LI~E TO SEE YOU ASSASSINATED BUT WE ALL MAVE OUR'
975 PRINT 'TRIVIAL PROSI.EMS,·
990 PRINTIFOR N.I TO \01.IIINT CHR$(1)/INEXT N
PRINT
~ONG fOR NOW,'IPRINT
999 ENO

HAMURABI:
I BEG TO REPORT TO YOU,
IN YEAR 1 , 0 PEOPLE STARVED., 5 CAME TO THE CIn'.
POPULAT I ON IS NOW 100
THE CITY NOW OWNS 1000 ACRES.
YOU HARVESTED 1 BUSHELS PER AC.'E,
RATS ATE 200 BUSHELS,
YOU NOW HAYE 2800 BUSHELS I N STORE.

0'

ue

"ao

129

LAND
HOl~

IS TRADING AT 17 BUSHELS PER ACRE,
MANY ACRES DO 't'OU WISH TO 8U't'? 20

HOW MANY BUSHELS DO YOU WISH TO FEED I'OUR PEOPLE? 1900
HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED? 100'l
BUT YOU ONLY HAVE 100 PEOPLE TO TEND THE FIELDS, NOW THEN.,
HOW t1ANY ACRES DO YOU WISH TO PLANT WITH SEED? 990

HAMURABI:

IN YEAR 2 ,

I

BEG TO REPORT TC' YOU.,

5 PEOPLE STARVED,

:1.1 CAME TO THE CIT't'.

POPULATION IS NOW 106
THE CITY NOW OWNS 1Il20 ACRES.
YOU HARVESTED 5 BUSHELS PER ACRE.
RATS ATE 0 BUSHELS.
YOU NOW HAVE 5015 BUSHELS I N STORE.
LAND

IS TRAD ING AT 26 BUSHELS PER ACRE.

HOW MANY t=lCRES DO '1'OU WISH TO E:U'T'? €I

HOW MANY ACRES DO 'IOU Wr SH TO SELL? 53
HOW MAN', BUSHELS DO YOU WISH TO FEEC' I'OUR PEOPLE·" 2120

HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED"

970

HANURABI:
I BEG TO REPORT TO YOU,
IN YEAR 3 , 0 PEOPLE STARVED" 5 CAME TO THE CITY.
POPULATION IS NOW 111
THE C IT I' NOW mms 970 ACRES.

YOU HARVESTED :2 BUSHELS PER ACRE.
RATS ATE 1855 BUSHELS
'-lOU NO~~ HA'lfE 3:795 BUSHELS

IN STORE.

LAND IS TRADING AT 20 BUSHELS F'E,: ACRE.
HOW MANY ACRES DO I'OU WISH TO BUI'? 50

HOW MANY BUSHELS DO 'iOU WISH TO FEED 'r'OUR PEOPLE? 222121
HOW MANY ACRES DO 'IOU WISH TO PLANT WITH SEED? 11210:121

HAMURA8I:
I BEG TO REPORT TO YOU,
IN YEAR 4 , 0 PEOPLE STARVED, 2 CAME
POPULATl ON IS NOW 11}
THE CITY NOW OWNS 1020 ACRES.
YOU HARVESTED 1 BUSHELS PEr:;: ACRE,
RATS ATE 0 BUSHELS,
YOU NO~~ HA'ItE 112175 BUSHELS IN STORE.

TO THE C I H,

LAND IS TRADING AT 21 BUSHELS PER 8CRE.
HO .. MANY ACRES DO ',01.1 WISH TO 8U','? 0
Hm4 MANY ACRES DO 'l'OU WISH TO SELL? 50
HOW MAN',.' BUSHELS DO 'lOU WISH TO FEED '1'01.11( PEOPLE? 220~3

HAMURRBI:

THINK AGAIN,

2125 BUSHELS OF GRAIN.
HO~4

'r'OU HA't'E ONL'T'
NOW THEN.,

MAN't' BUSHELS DO 'lOU WISH TO FEED 'r'OUR PEOPLE? 15121121\012151\1725

HOW MANY ACRES DO YOU .. ISH TO PLANT WITH SEE,";' <:00
HAMURAB I :
TH I NK AI3A I N. ','OU HAVE ONL Y
400 BUSHELS OF GRRIN.
NOW THEN,

HOW t1AN',' ACRES DO ','01.1 WISH TO PLANT WITH SEEe,? 79121

HAMURABI:
I ,8EI3 TO REPORT TO 'l'OU~
IN YEAR 5 , 27 PEOPLE STRR'1ED, 2 CAME TO THE CIT,'
HORRIBLE PLAGUE STRUCK!
HALF THE PEOPLE e'IEe,.
POPULAT I ON I SNOW 44
THE CITY NOW OWNS 97@ ACRES.
YOU HAR'IESTED 3 BUSHELS PEP RCRE.
RflTS ATE :2 BUSHELS.
YOU NOW HAVE 2373 BUSHELS IN STORE.

n

LAND IS TRADING AT 26 BUSHELS PER ACRE.
HOW MANY ACRES DO '1'01.1 lHSH TO BU'l'? 121
t1ANY ACRES DO YOU WISH TO SELL? 50

HO~~
HOl~

t1ANY BUSHELS DO YOU WISH TO FEED 'l'OUr<: F'EOPLE? ::::30

HOi~

MANY ACRES DO YOU WISH TO PLANT WITH SEED:' 4]:@

HRMURABI:

I BEG TO REPORT TO '1'(1).
IN '-rEAR 6 • 121 PEOPLE STARVED, 15 CAME TO THE C I T'l'.
PIJPULATION IS NOW 59
THE CITY NOW OWNS 920 ACRES.
YOU HARVESTED 5 BUSHELS PER RCRE.
RATS ATE 1289 BUSHELS.
NOW HA ..... E 3419 BUSHELS I N STORE.

'.,'ou

LAND IS TRADING AT 22 BUSHELS PER ACRE.
HOW MAN"? ACRES DO YOU WI $H TO BlI~'? f2I
HOW t~AN"? ACRES DO '1'OU WISH TO SELL? 121
HOW t1ANY BUSHELS DO '1'(1) WISH TO FEED ~'OUR PEOPLE? 11:::0
HOW MANY ACRES DO ',OU WISH TO PLANT WITH SEED? 5:,:0

HAMURABI:
I BEG TO REPORT TO YOU.
IN YEAR 7 , 0 PEOPLE STA.,\'ED, 12 CAME TO THE CIT'<.
POPULATION 15 NOW 71
THE CITY NOW OWNS 920 ACRES.
'·IOU HARVESTED ~ BUSHELS PER AC':E.
RATS tHE ~ BUSHELS.
YOU N01~ HAVE 3709 BUSHELS IN STORE.

HOCKEY

ICE HOCKEY VS. CORNELL

Description
This is a simulation of a regulation, three-period ice hockey
game. Your opponent is Cornell University. You may use three
kinds of shots:
1.
2.
3.

Slap Shot
Flick Shot
wrist Shot

The game is very comprehensive starting with the face-off, and
throughout the game with icing and high sticking penalties,
shots hitting the post, shots being wide and being blocked
by the goalie.
In the event of a tie at the end of three periods, the game
automatically goes into sudden-death overtime.
Program Author
Thanks to Mrs. Kingsley Norris for submitting the program.
It was written by:
Charles Buttrey
Eaglebrook School
Deerfield, MA 013~2

130

PROGRAM LISTING
10

2~

30
4~

50
60
70
90
100
110
120
130
140
150
160
170
IU
190
2~0

210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
390
400
410
420
430
440
450
460
470
480
490
500
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730
740
750

~ET AloINTCl4.RNO(Xl+6l
~ET Xol
REM ••• CONVERTED FROM BRAND X TO DIGITA~ RSTS/E BY DAVID AH~
PRINT" N,8, THIS PROGRAM IS DESIGNED FOR THOSE WHO KNOW NOTHING'
PRINT" ABOUT HOCKEY ~IKE MYSE~F,
C, BUTTREY"
PRINT" THIS IS CORNE~~ U, HOCKEY,"
PRINT" I AM CORNE~~. WHO ARE YOU'I
INPUT A$
PRINT
PRINT' YOU HAVE THREE SHOTS."
PRINT
I. S~AP SHOT,"
PRINT
2, nICK SHOT."
3. WRIST SHOT. II
PRINT'
PRINT
PRINT' HERE IS THE fACE-OFF."
PRINT" SCORE."
PRINT • CORNE~~ "A

P~INT

" "AS" "B

IF X02 THEN 240
IF X03 THEN 260
IF hB '0 (I/3.AI) THEN 1560
GOTO 290
IF A+a >. e2l3*AI) THEN 1630
GOTO 290
IF eA+Bl >0 eAI) T"EN 1710
GOTO 290
IF B03 THEN 1560
~ET CoINTC2*RNOeX).I)
IF Col THEN 330

PRINT" "ASII WINS THE FACE .. OFF,"
GOTO 650
PRINT" CORNELL TAKES THE FACE-OFF,"
~ET

DoINT(3*RNO(~)+I)

IF Dal THEN 500
IF 002 THEN 070

PRI'lT " IIIRIST SHOT ... "
~ET EOINTCo.RNOeX)+ll
IF E04 THEN 470
PRINT" SHOT IS MISSED,"
~ET FoINTC2*RNDeX)+I)
IF FOI THEN 450
PRINT ' CORNE~" REGAINS THE PUCK,"
GOTO 340
PRINT !I "A$II TAKES THE PUCK."
1i0TO 650

PRINT" •• GOODJ*_"
I.ET AoUI
GOTO 160

PRINT

SLAP SHOT.

'I

H

II

~ET

CIOINT(3*RNO(X)+1l
IF C102 TH!.N 540
GOTO 560

PRINT" ICING PENALTy ••••• "
GOTO 45"
GOTO 360

PRINT

FLICK SHOT,,"

II

LoET SlaINTt3*RND(O+\l
IF 51=3 THEN 610
GO TO 640
PRINT " PENA~TY FOR t'lIGH STICKING I CORNEI.!. MAN PUT IN 80X FOR"
PRINT" TWO MINUTESI"
GOTO 1110
GOTO 360
PRINT" YOUR SHOT"I
INPUT G
IF GOI THEN 720
IF .-2 THEN W00
IF Ga3 THEN 970
PRINT" INPUT EITHER 'II 121 OR 131"
GOTO 650
PRINT ' S~AP SHOT,"
~ET ZloINT(3*RNO(X)+I)
IF ZI02 THEN 760
GO TO 780

760

PRINT" ICING PENALTy, •••• "

770
780
790
800
810
820
830
840
850

GOTO 1090
~ET HaINTCS*RNDeX)+I)
IF Hoi THEN 870
PRINT" SHOT IS ,HOE,"
~ET I o INH2*RNDeX)+I)
IF 101 THEN 850
PRINT " CORNE~1. TAKES THE PUCK,'
GOTO 990

86~

GOTO 650

870
880
890
900
910

PRINT

920
930
940
950
960
970
980
990
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1\00
1110

PRINT

IIA$"

JI
II

••

R:EGAINS THE, PUCI<_.'!

GOODl.""

~ET

606.1
GOTO 160

PRINT

2~50

FLICK SHOT •••• "

tI

2060
2070
2080
2090
2100
2110
2120
2130
2140
2150
2160
2170
2180
2190
2200
2210
2220
2230
2240
2250
2260
2270
2280
2290
2300

I.ET 6IaINTC3*RNO(Xl*l)
IF Bioi THEN 940
GOTO 960

PRINT

ICING PENALTy ••••• "

II

GOTO 830
GOTO 780

PRINT

~RIST

tI

SHOT •• "

GOTO 780
PRINT" CORNE!.!. SHOT!"
~OT JoINT(3.RNDeX)*1l
If Jol THEN 1180
IF J02 THEN 1210
PRINT " S~AP SHOT,"
~ET KoINTt5.RNOeX)+ll
IF Kol THEN 1130
~RINT " 8HOT HITS THE POST,"
~~T

~OINT(2.RNO(Xl+1l

IF ('01 TH~N 1110
PRINT" CORNEI.(' REGAINS THE PUCK,"
GOTO 990
~RINT

" ".AS" REGAIN.S TME PUCI<."

112~
113~

GOTO 1310

1140
1150
1160
1170

~ET

PRINT

II

."'GOOO, •• "

AoHI
GOTO 160
PRINT" WRIST SHOT"
UT MoINT(S.RNO(X)+I)

1180
11P0
1200
1210
1220
1230
1240
1250
1260
1270
1280
1290
1300
1310
1320
1330
1340
1350
1360
1370
1380
1390
1400
1410
1420
1430
1440
1450
1460
1470
1480
1490
1500
1510
1520
1530
1540
1550
1560
1570
1580
1590
1600
1610
1520
1630
1640
1650
1660
1670
1680
1690
1700
1710
1720
1730
1740
1750
1760
1770
1760
1790
1800
1810
1820
1830
1840
1850
1860
1870
1880
1890
1900
1910
1920
1930
1940
1950
1960
1970
1980
1990
2000
2010
2020
2030
2040

131

I~ Moe THEN 1130
PRINT" SHOT IS HIGH."
GOTO 1070
PRINT " F('ICK SHOT'
~ET TlaINT(3*RNO(Xl+I)
IF TI.I THEN 1250
GOTO 1270

PRINT" ICING PENALTy ..... "
GOTO 450
~ET N-INTe5*RNoeX)+1l
I f Nol THEN 1130
PRINT" SHOT IS 6~OCKED BY THE GOA~IE,"
GOTO 1070
PRINT" YOUR SHOT" 1
INPUT 0
IF 0-1 T~EN 1430
IF 002 THEN 1540
PRINT " w~IST SHOT,'
~ET pOINT e5.RNDeX)*ll
IF P.2 THEN 870
PRINT" SHOT IS BARE~Y WIDE .. ,"
L.ET QoINTC3.RNOeX)*ll
IF QOI THEN 830
PRINT" "AS" REGAINS THE PUCK,"
GOTO 650
.
PRINT" SL.AP SHOT"
~ET DlaINT(3.RND(X)*I)
IF Dl03 THEN 1470
GOTO 1500
PRINT " PEN~(.TY FOR HIGH STICKING I "A$" HAN PUT IN PENA~TY"
PRINT" sox FOR TWO MINUTES"
GOTO 83~
~ET R-INT(S*RNDeX)+ll
If Rol THEN 870
PRINT' SHOT IS TAKEN BY THE CORNE~L. GOA~IE,"
GOTO 830
PRINT " f~ICK SHOT"
GOTO 1500

PRINT"

•• ." •• ENO OF FIRST PERIOD ••••• "

~ET x02
PRINT" SCORE:"
PRINT " CORNE~('

"~

PRINT" "AS" "8
PRINT" START OF SECOND PERIOD,"
GOTO 160

PRINT" ••••• ENO OF SECOND PERIOD •••• *"

~ET X03
PRINT" SCOREI"
PRINT" CORNEl.l. "A

PRINT" "AS" liB
PRINT 1111
PRINT" START O'
GOTO 160
P~INT

II

•••••

THI~D

PERIOD,"

END Of GAME ••••• "

IF A-e THEN 1770
PRINT" fINAL SCORE:"

PRINT

II

CORNELL

",6

PRINT" "AS" itS
STOP
PRINT" SINCE SCORE IS TIED, WE
PRINT" INTO SUDOEN-DEATHI"
PRINT" HERE IS THE FACE_OFF,"
II

SCOREr"

PRINT "

PRINT

CORNE~~

WI~L.

"A

PRINT" 111\,$" "B
~ET

SoINT(2*RNOeX)*I)
IF SOl THEN 1870

PRINT

II

IIA$" II/INS THE F.ACE.OFF ,II

GOTO 2080
POlINT " CORNE~1. WINS THE
UT r oINT(3*RNOeX)+I)
IF Tol THEN 2040
IF 102 THEN 2060

PRINT

II

F4CE-0~F,"

WRIST S",OT.1t

~ET

UoINTCs*RNOeX)+1l
IF U-I THf.N 2010
PRINT" SHOT IS HISsED,'
~ET vaINT(2*RND(Xl+1l
IF Vol THEN 1990

PRINT" ".6$" TAKES THE.

PUC~."

GOTO 2080
PRINT " CORNE~~ REGAINS THE PUCK,"
GOTO 1880

PRINT

II

••

GOODI""

~ET A'A_I
GOTO 2260
PRINT' SI.AP SHOT"
GOTO 192~
PRINT" fLICK SHOT,"
GOTO 1920
PRINT" YOUR SHOT"I
INPUT W
IF .01 THEN 2220
IF .02 THEN 2240

PHI"IT "wRIST 51010T.''
~ET YoINT(S*RNOCX)+U
IF Y'4 THEN 2190
PRINT" SHOT IS MISSED,"
~ET ZaINT(2*RNO(Xl+ll
IF ZOI THEN 1990
GO TO 1970

PRINT" •• GOODI •• "
~ET B.e+l
GOTO 2260

~RINT

" SLA.P SHOT. q

GOTO 2130
PRINT " FLICK SHOT,"
GOTO 2130
PRINT' GAME IS OVERII"
PRINT " FINA~ SCORE:"
PRINT " CORNE~~ "A

PRl"lT
END

q

"".Slt "8

HAVE TO GO"

SAMPLE RUN
N. 8. TH I S PROGRAM I S DES UlNED FOR THOSE WHO KNOW NOTH I NG
ABOUT HOCKEY L I IE.
HARVARD REGAINS THE PUCK.
YOUR SHOT? 2
FLICK SHOT....
ICING PENALTY.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
FLICK SHOT
ICING PENALTY.
HAR\'ARD TAKES THE PUCK.
YOUR SHOT? l
WRIST SHOT ..
SHOT IS WIDE.
HARVARD REGAINS THE PUCK.
YOUR SHOT? 2
FLICK SHOT ....
SHOT IS WIDE.
HARVARD REGAl NS THE PUCK.
YOUR SHOT? 1
SLAP SHOT.
**GOOD!**
HERE IS THE FACE-OFF:
SCORE:
CORNELL 0
HARYARD 1
HARYARD WINS THE FACE-OFF.
YOUR SHOT? 3
WRIST SHOT..
SHOT IS WIDE.
HARVARD REGAl NS THE PUCK.
YOUR SHOT? 2
FLICK SHOT ... .
ICING PENALTY .. .
CORNELL TAKES THE PUCK.
CORNELL SHOT:
FLICK SHOT
ICING PENALTY.
HARYARD TAKES THE PUCK.
YOUR SHOT? 1
SLAP SHOT.

**GOOD!**
HERE 15 THE FACE-OFF:
SCORE:
CORNEL'L 0
HAR\'ARD 2
CORNELL TAKES THE FACE-OFF.
WRIST SHOT ...
SHOT ISM I SSED.
CORNELL REGAINS THE PUCK.
WRIST SHOT ...

**GOOD!**
HERE IS THE FACE-OFF:
SCORE:
CORNELL 1
HARYARD 2
CORNELL TAKES THE FACE-OFF.
WRIST SHOT ..
SHOT ISM I SSED.
HARYARD TAKES THE PUCK.
YOUR SHOT? 1
SLAP SHOT.
SHOT IS WIDE.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
FLICK SHOT
SHOT IS BLOCKED BY THE GOALIE.
HARVARD REGAl NS THE PUCK.
YOUR SHOT? 2
FLICK SHOT
SHOT 15 TAKEN BY THE CORNELL GOALIE.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
SLAP SHOT.
SHOT HITS THE POST.
HARIIARD REGA I NS THE PUCK.
YOUR SHOT? 3
WRIST SHOT.
SHOT IS 'BARELII WIDE.'.
HARVARD REGA I NS THE PUCK.
YOUR SHOT? :3
WRIST SHOT.
SHOT IS WIDE.
HARVARD REGA I NS THE PUCK.
IIOUR SHOT? 2
FLICK SHOT ....
SHOT IS WIDE.
HARYARD REGAINS THE PUCK.
YOUR SHOT? 1
SLAP SHOT.
SHOT IS WIDE.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
SLAP SHOT.

I C I NG PENAL TY .....
CORNELL REGA I NS THE PUCK.
CORNELL SHOT:
SLAP SHOT.
SHOT H ITS THE POST.
HARYARD REGAINS THE PUCK.
YOUR SHOT? 2
FLICK SHOT
**GOOI)!**
HERE I S THE FACE-OFF:
SCORE:
CORNELL 2
HARVARD 3
HAR\'ARD WINS THE FACE-OFF.
YOUR SHOT? :3
WRIST SHOT ..
SHOT IS WIDE.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
FLICK SHOT
SHOT I S BLOCKED BY THE GOAL I E.
HARYARD REGAINS THE PUCK.
YOUR SHOT? 2
FLICK SHOT
SHOT IS TAKE-N BY THE CORNELL GOAL I E.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
WRIST SHOT
**GOOI)!**
HERE IS THE FACE-OFF:
SCORE:
CORNELL 3:
HARYARD 3:
***** END OF FIRST PER I OD
SCORE:
CORNELL 3
HARYARD :3
START OF SECOND PER I OD.
HERE IS THE FACE-OFF:
SCORE:
CORNELL 3
HARYARD l
HARVARD WINS THE FACE-OFF.
YOUR SHOT? 1
SLAP SHOT.
SHOT IS WIDE.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
FLICK SHOT
SHOT IS BLOCKED BI' THE GOALIE.
CORNELL REGAINS THE PUCK.
CORNELL SHOT:
FLICK SHOT
ICING PENALTY.
HAli:I'ARD TAKES THE PUCK.
YOUR SHOT? 2
FLICK SHOT....
SHOT IS WIDE.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
SLAP SHOT.
SHOT H ITS THE POST.
CORNELL REGA INS THE PUCK.
CORNELL SHOT:
FLICK SHOT
SHOT IS BLOCKED BY THE GOALIE.
CORNELL REGAINS THE PUCK.
CORNELL SHOT:
WRIST SHOT
SHOT IS HIGH.
HARYARD REGAINS THE PUCK.
YOUR SHOT? :3
WRIST SHOT.
SHOT I S BARELY 101 I DE ..
HARVARD REGA I NS THE PUCK.
YOUR SHOT? 2
FLICK SHOT. ...
leIN(; PENALTY.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
WRIST SHOT
SHOT IS HIGH.
HARYARD REGAINS THE PUCK.
YOUR SHOT? 1
SLAP SHOT
SHOT I S TAKEN BII THE CORNELL GOAL I E.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
SLAP SHOT.
SHOT HITS THE POST.
HARVARD REGAINS THE PUCK.
YOUR SHOT? 2
FLICK SHOT

*****

**0001)!**
HERE 15 THE FACE-OFF:
SCORE:
CORNELL :3
HARVARD 4

**0001)!**
HERE IS THE FACE-OFF:
SCORE:
CORNELL 2
HARYARD 2
CORNELL TAKES THE FACE-OFF.
WRIST SHOT...
SHOT IS MISSED.
HAR\'ARD TAKES THE PUCK.
YOUR SHOT? 1
SLAP SHOT.

132

CORNELL TAKES THE FACE-OFF.
SLAP SHOT...
ICING .PENALTY .....
HARYRRI> TRKES THE PUCK.
YOUR SHOT? 3
WRIST SHOT..
SHOT IS WIDE ..
CORNELL TAKES THE PUCK.
CORNELL SHOT:
SLAP SHOT.
SHOT HITS THE POST.
CORNELL REGR I NS THE PUCK.
CORNELL SHOT:
FLICK SHOT
SHOT I S BLOCKED. BII THE GOAL I E.
HARIIRRD REGA I NS THE PUCK.
YOUR SHOT? 2
FLICK SHOT
SHOT I S TAKEN BV THE CORNELL GOAL I E.
CORNELL TAKES THE PUCK.
CORNELL SHOT:
WRIST SHOT
*"'GOO[)!**
HERE IS THE FRCE-OFF:
SCORE:
CORNELL 4
HARYARD 4
HARYARD WINS THE FACE-OFF.
YOUR SHOT? 2
FLICK SHOT ....
SHOT IS WIDE.
HARYARI> REGA I NS THE PUCK.
YOUR SHOT? 2
FLICK SHOT ....
**GOOD!**
HERE IS THE FACE-OFF:
SCORE:
CORNELL 4
HARYARD ~
CORNELL TAKES THE FRCE-OFF.
SLAP SHOT ...
SHOT IS MISSEl>.
HARYARD TAKES THE PUCK.
YOUR SHOT? 3
WRIST SHOT..
**GOoCr!**
HERE IS THE FRCE-OFF:
SCORE:
CORNELL 4
HARVARD 6
HARYRRD WINS THE FRCE-OFF.
.,.OUR SHOT? 1
SLAP SHOT.
SHOT IS 101 IDE.
HARYARD REGR I NS THE PUCK.
VOUR SHOT? 1
SLAP SHOT.
I C I NG PENAL Til .....
CORNELL REGA I NS THE PUCK.
'CORNELL SHOT:
WRIST SHOT
SHOT IS HIGH.
CORNELL REGA I NS THE PUCK.
CORNELL SHOT:
FLICK SHOT
SHOT I S BLOCKED 81' THE GOALI E.
HARYARD REGA I NS THE PUCK.
.,.OUR SHOT? 3
WRIST SHOT.
SHOT I S BAREL II 101 I DE.
HARIIARI> REGR I NS THE PUCK.
YOUR SHOT? 2
FLICK SHOT. ...
SHOT IS WIDE.
HARYARD REGA I NS THE PUCK.
YOUR SHOT? 1
SLAP SHOT.
ICING PENALTY .....
CORNELL REGAl NS THE PUCK.
CORNELL SHOT:
WRIST SHOT
SHOT IS HIGH.
CORNELL REGAINS THE PUCK.
CORNELL SHOT:
SLAP SHOT.
SHOT HITS THE POST.
CORNELL REGA I NS THE PUCK.
CORNELL SHOT:
WRIST SHOT
**GOOD!**
HERE IS THE FACE-OFF:
SCORE:
CORNELL 5
HARYARD (;
***** END OF SECOND' PER I 00 "'''''''.to ...
SCORE:
CORNELL 5
HARYARI> EO

HORSES

BETTING AT A HORSERACE

Description
This program simulates a one-mile horse race for three-year old
thoroughbreds. You can place any number of bets on the outcome
of the race. There are four elements to a bet:
1.
2.
3.
4.

Horse number (1 to 8)
Position (Win=l, P1ace=2, Show=3)
Amount of wager ($2 minimum, $300 maximum)
Bet signal (1 for more bets to follow, 0 to close
betting)

The computer then gives you the position of the eight horses at
eight points around the raceway. At the end, it tells you what
each horse paid and what you won (or didn't win) on each of your
bets.
Source
The published program has been around DIGITAL for as long as
anyone can remember. Its author is now unknown. Other interesting horse race progr~s were submitted by Robert Goodman,
Southfield, Mich.1 Don Viola, Staten Island, NY1 and Paul
Garmon, Wellesley Hills, Mass.

•

133

PROGRAM LISTING

SAMPLE

DIM V I 10) ,UI II),T( U!'; M(8) ,0181 ,iHS) ,1i/81 ,P(6l
RANDOMIZE' PRINT '~OR8E RAC~'
3 PRINT "EXAMPLE OF BETI 1'2'200,0 . '
5 PRINT , PRINT'
SEVENTH - 1 MILE, 3 YR. OLDS
6 PRINT
7 ~OR 1'1 TO 8
8 B(I)'I , GOSUB 210
9 RUD 0111 , PRINT 0(1)'/1'
10 MII)'1I0005hOII)) I (011)+1)
II NUT f
12 PRINT
13 PRINT'ENTER HORSiIl-8I1TO ~IN,PLACE,SHOw!l,2,3I1AND THE wAGER."
14 PRINT 'AND II FOR NO MORE BETTING OR I OR MORE BETTING."
15 LET S • 0
16 PRINT
17 LET S • S + I
18 PRINT'BET NO. "'S,
19 INPUT T(S),UIS),VIS),~
2~ LET TlSI.ABSCINTCT(Slll
21 IF TCS).8 THEN 25
22 IF TlS)CI THEN 26
23 LET U(SI'ABScINTCUCSll)
24 IF UIS»3 THEN 26
25 IF UIS).0 THEN 2a
26 PRINT'HORSE NO. OR oh-pLACE-SMoo h ERROR' \ GO TO 18
28 IF V(S)C2 THEN 30
U IF VlSI c'300 THEN 33
30 PRINT'BET MUST BE >$2 AND cU00, BET AGAIN"
31 INPUT VCSI , GO TO 28
33 IF M • I THEN 17
35 PRINT' PRINT"
THEY'RE OFF. AND RUNNING - ' , PRINT
36 FOR 1.1 TO 8 , HCI).0 \ NEXT I
40 FOR ~'I TO 8
42 SLEEP 6
44 FOR J'! T,O 8
46 HCJ)'HCJ)+RND(0)oMCJ)
48 NEXT J
52 FOR 1'8 TO I STEp -I
54 FOR J'2 TO I
56 ON SGNCHCBCJ-I)I-HCBIJ)))+2 GO TO 60,58,62
58 IF RND(0»,5 THEN 62
6i1 Z'BCJ-II , BCJ-II'BCJI \ B(J).Z
62 NEXT J
64 NEXT I
.,
6B PRINT \ PRINT"
70 ON ~ GOTO 72,74,76,78,811,82,84,86
72 PRINT "AS THEy BREAK FROM THE GATE" \ GO TO Be
74 PRINT "AT THE 1/4 MILE POLE" \ WO TO 88
76 PRINT 'NE~RING THE HALFWAY MA~K' , GO TO 88
78 PRINT "MID~AY IN THE RACE" \. GO TO
80 PRINT "AT 5/8 OF A MILE" \ GO TO 88
82 PRINT "ROUNDING THE TURN" \ GO TO 88.
84 PRINT 'COMING DOWN THE STRETCH' , GO TO 88
86 PRINT"
FINISH"
88 REM
90 GO suB 200
92 NEXT K
,
96 P~INT \ PRINT
PRINT 'S2 MUTUELS PAID"
98 PRINT"
STRAIGHT
PLACE
le0 ~'0
le2 FOR 101 TO 3
104 GO eUB 215
106 FOR J'I TO J
108 L'2 0 I+J-3 , P (L) .1.5+ ,IOINT( .1* I NT( C4*0 C8 ( l II I CJ* CJ+ III +RND C0 no U0+5)1
110 PRINT TABC3+10*JI/ , B'-16
- ..
112 fOR M'J TO -I STEP -I
114 P'INTtPCLI/(!0AMII
116 P'P_100INT(P/10)
117 IF P'0 THEN 118 \ B.0
1\8 PRINT CHR$C48+p+BII
138 IF M<>e THEN 139 , PRINT ',"
139 NEXT M
140 PRINT 'e',
142 NEXT J
144 PRINT
146 NEXT I
180 PRINT \ Q.e
152 FOR J'I TO 8
154 PRINT "SET NO, "' J
15S P'0
158 FOR 101 TO 8 \ MCBCIlloI \ NEXT I
160 IF UCJICMCTeJll THEN 166
le2 P.
INT( (V (J 105010P CU I J I +H (T CJll*2-JII
164 PRINT "YOU COLLEn" P 'ON ., \ GO TO 172
IS6 IF HCT(Jll'3 THEN 168 \ PRINT 'NEXT TIME, BUY A SHO.", , GO TO 170
168 PRINT "TEAR UP YOUR",
170 PRINT" TICKET ON "'
172 1'0 \ BC01'TCJI , GOeuS 215 \ PRINT
174 Q'Q*P-VCJ)
176 NEXT J
178 IF QC0 THEN 182
180 PRINT "YOUR TOTAL "INNINGS AMOUNT To $' Q , STOP
182 PRINT "YOUR TOTAL LOSSES AMOUNT TO S' ABSIQI \ STOP
200 PRINT "POS,
HORSE
LENGTHS B!HIND"
205 FOR I ' ! TO B
2IB PRINT II
218 ON BCI) GOTO 220,222,224,226,228,230,232,234
2211 PRINT "MAN O'WAR
", \ GO TO 240
222 PRINT "CITATION
'J' GO TO 240
224 PRINT 'WHIRLAWAV
", \ GO TO 240
226 PRINT "ASSAULT
""
GO TO 2'0
228 PRINT .SEABI8CUIT "
, GO TO 240
231 PRINT IG~~LANT FOX', \ GO TO 240
232 PRINT "STyMIE
'"
, GO TO 240
.,
234 PRINT 'COALTOwN
2411 IF K'0 THEN 260
245 IF 1>1 THEN 250 \ PRINT , Go TO 255
250 PRINT ,loINTCHCBCII'-HCBIIlll
255 NEXT 1
260 RETURN
301 DATA 3,4.5,8,9,11,20,30
9n END

as

,S\.

134

~UN

IfoRSE RAC~
EXAMPLE OF 8ET, 1;2,200.0
SEVENTH 1 MAN O'WAR
2 CITATION
3 WHIRLAWAY
4 ASSAULT
5 SEA8ISCUIT
6 GALLANT FOX
7 STYMIE
8 COAL TOWN

1 MI LE,

3 YR.

OLDS

POST 2:35

3 :1
4

:1

5 :1
8 :1
9 :1
11 :1
20 :1
30 :1

ENTER HORSE(1-8l;TO WIN,PLACE,SHOW(1,2,3l;P.ND THE WAGER.
AND 0 FOR NO MORE 8ETTING OR 1 OR MORE BETTING.
BET
BET
BET
BET
8ET

NO.
NO.
NO.
NO.
NO.

?
?
?
?
:; ?
1
2
3
4

2,1,100,1
3,2,100,1
4,2,100,1
1,3,100,1
5,3,100, e

THEY'RE OFF AND RUNNING AS THEY BREAK FROM THE GATE POS.
HORSE
LENGTHS BEHIND
WHIRLAWAY
SEABISCUIT 1.2
STYMIE
1.9
GALLANT FOX 2. 3
ASSAUL T
3. 5
CITATI ON
4. 5
MAN 0' WAR
4. 7
COAL TOWN
5. 1
AT THE 1/4 MILE POLE POS.
HORSE
LENGTHS BEHIND
1 STYMIE
2 WHIRLAWAY
.2
3 CITATION
.5
4 GALLANT FOX . 7
5 COAL TOWN
1.7
6 SEA8lSCUIT 2.1
7 MAN O'WAR
3.7
8 ASSAULT
4. 2
NEARING THE HALFWAY MARK POS.
.HORSE
LENGTHS BEHIND .
1 CITATION
2 STYMIE
.S
3 GALLANT FOX 4. 1
4 ASSAULT
4. 1
5 WHIRLAWAY
4. J
6 COAL TOWN
4. 9
7 SEABISCUIT 5.1
8 MAN O'WAR
~ 3
ROUNDING THE TURN POL
HORSE
LENGTHS BEHIND
1 WHIRLAWAY
2 GALLANT FOX 1.6
3 STYMIE
2.2
4 ASSAULT·
3.9
5 CITATION
5.6
6 SEABIScUIT 6.6
7 COAL TOWN
10.9
8 MAN O· WAR
11
.COMING DOWN THE STRETCH POS.
HORSE
LENGTHS BEHIND
1 ·WHIRLAWAY
2 STYMIE
0
3 CITATION
1.8
·4 GALLANT FOX 2.1
5 ASSAULT
2. 8
6 SEABISCUIT 6.8
7 MAN O'WAR
8.4
8 COAL TOWN
10.7
FINISH
HORSE
LENGTHS BEHIND
1 CITATION
2 STYMIE
.7
1.1
3 ImlRLAWAY
4 GALLANT FOX 3.3
6.4
5 ASSAULT
6 MAN O'WAR
10.2
7 SEABISCUIT 10.5
14.5
8 COAL TOWN

pos.

$2 MUTUELS PA I D:
STRAIGHT
9.97

CITATION
STYMIE
WHIRLAWAY

PI,ACE

4.44
15. 48

·BET NO.
1
VOU COLLECT 498. 5 ON CITATION
8ET NO.
2
TEAR UP YOUR TICKET ON WHIRLAWAY
BET NO.
3
TEAR UP YOUR TICKET ON ASSAULT
NO.
4
TEAR UP YOUR TICKET ON MAN O'WAR
BET NO.
5
TEAR UP YOUR TICKET ON SEABI5CUIT
YOUR TOTAL LOSSES AMOUNT TO $ 1. 5

sn

SHOW
~. 18

8.9
3.72

HURKLE

FIND THE HURKLE IN HIDING

Description
Hurk1e? A Hurk1e is a happy beast and lives in another galaxy
on a planet named Lirht that has three moons. Hurk1e are
favorite pets of the Gwik, the dominant race of Lirht and •••
well, to find out more, read liThe Hurk1e is a Happy Beast"
in the book A WAY HOME by Theodore Sturgeon published by Pyramid.
In this program a shy hurk1e is hiding on a 10 by 10 grid.
Homebase is point 0,0 in the Southwest corner. Your guess as
to the gridpoint where thehurk1e is hiding should be a pair
of whole numbers, separated by a comma. After each try, the
computer will tell you the approximate direction to go look
for the Hurk1e. You get five guesses to find him.
NORTH
9
8
7

6

WEST

EAST

5
4

-r--...,

I~

3
2
1

o

HO~BASE/O

This is

G ridpoint

1

2

3

4

SOUTH
Program Author
Bob Albrecht
People's Computer Company
Menlo Park, CA 94025

135

5

6

7

8

9

7,3

SAMPLE RUN

PROGRAM LISTING
90
100
105
11e
120
210
22e
230
240
250
260
270
280

285
286
310
320

330
340
350
360
370

lse
410
420
430
440
450
460
470
500
'510
520

530

540
610
620
630
640
650
660
(.70
680
690
700
710
720
730
999

*

REM •• CONVERTED TO RSTS/E BY DAVID AHL, DIGITAL
REM HURKLE - PEOPLE'S COMPUTER COMPANY, MENLO PARK CA
RANDOM
N=5
G=10
PR[NT
PRINT "A HURKLE [5 HID[NG ON A"; G; "BY"; G; "GRID, HOMEBASE"
PR[NT "ON THE GRID [S POINT 0, a AND ANY GRlI>POINT IS A"
PR[NT "PAIR OF WHOLE NUMBERS SEPARATED BY A COMMA, TRY TO"
PR[NT "GUESS THE HURKLE'S GRIDPOINT, YOU GET"; N; "TRIES, "
PR['NT "AFTER EACH TRY, I WILL TELL YOU THE APPROXIMATE"
PR[NT 'D[RECTION TO GO TO LOOK FOR THE HURKLE, "
PRINT
A=[NT(G*RND(0»
B=INT(G*RND(0»
FOR K=1 TO N
PRINT "GUESS ."; K;
[NPUT X, Y
[F ABS(X-A)+ABS(Y-B)=e THEN 5ee
REM PRINT INFO
GOSUB 610
PRINT
NEXT K
PR[NT
F'R[NT "SORRY, THAT'S"; N; "GUESSES, "
PRINT "THE HURKLE IS AT "; A; ", "; B
PRINT
PRINT "LET'S PLAY AGAIN, HURKLE IS HIDING, "
PRINT
GO TO 285
REM
PRINT
F'RINT "YOU FOUND HIM IN"; K; "GUESSES!"
FOR 1=1 TO 10\PRINT CHR$(7);\NEXT I\PRINT
GO TO 440
PR[NT "GO ";
[F Y=B THEN 670
IF Y{B THEN 660
PI< I NT "SOUTH";
GO TO 670
PR[NT 'NORTH";
[F X=A THEN 720
IF X{A THEN 710
PRINT "WEST";
GO TO 720
N:INT "EAST";
F'RINT
RETURN
END

RE:ADY

A HURKLE IS HlDlNG ON A 18 BY 18 GRID, HOI'1EBASE
ON THE GRID IS POINT 8,8 AND AN~ GRIDPO[NT IS A
PAIR OF WHOLE NUMBERS SEPARATED BY A COMMA, TRY TO
GUESS THE HURKLE'S GR[DPOINT, YOU GET 5 TRIES,
AFTER EACH TRY, I WILL TELL ~OU THE APPROXIMATE
D I RECTI ON TO GO TO LOOK FOR THE HURKLE,
GUESS t 1 ? 5, 5
GO NORTHEAST
GUESS • 2 ? 7, 7
GO EAST
GUESS .. 1 ? 8;7
YOU FOUND HIM IN 3 GUESSES!
l.ET'S PLAY AGA [N,

HURKLE IS HIDING,

GUESS • 1 ? 4, 4
GO NORTHWEST
GUESS • 2 ? 2, 7
GO NORTHWEST
GUESS" 3 ? 1,8
GO NORTH
GUESS i

4 ? 1,9

\'OU FOUND HIM IN 4 GUESSES!
LET'S PLAY AGA I N,

HURKLE IS HIDING,

GUESS. 1 ? 4,5
GO SOUTHEAST'
GUESS. 2 ? 7,2
GO NORTHWEST
GUESS # 3 ? 8, 4
GO SOUTHWEST
GUESS • 4 ?
GO WEST
GUESS t

6~

3:

5 ? 5,l

I'OU FOUND H[M IN 5 GUESSES!
LET'S PLAY AGA [N,

HURKLE IS HIDING,

GUESS # 1 ? 4,O
GO NORTHWEST
GUESS • 2 ? 2,5
GO NORTH
GUESS .. 3 ? 2,7
GO NORTH
GUESS. 4 ? 2,8
\'OU FOUND HIM IN 4 GUESSES!
LET'S PLAY AGA I N,

HURKLE IS HIDING,

GUESS. 1 ? 9,9
GO SOUTHWEST
GUESS t 2 ? 7, 7
GO SOUTHWEST
GUESS t 3 ? 5,5
GO SOUTHEAST
GUESS • 4 ?
GO NORTH

6~

0:

GUESS • 5 ? 6J 1
GO 'NORTH

SORRY, THAT'S 5 GUESSES,
THE HURKLE 15 AT 6, 3

136

KINEMA

THROW A BALL UP IN THE AIR

Description
This program tests your fundamental knowledge of kinematics.
It presents a simple problem: a ball is thrown straight up
in the air at some random velocity. You then must answer
three questions about the flight of the ball:
1.
2.
3.

How high will it go?
How long until it returns to earth?
What will be its velocity after a random number of
seconds?

The computer evaluates your performance~ within 15% of the
correct answer is considered close enough. After each run,
the computer gives you another problem until you interrupt
the program.
Program Author
KINEMA was shortened from the original Huntington Computer
Project Program, KINERV, by:
Richard F. Pav
Patchogue High School
Patchogue, New York

A BALL IS THROWN UPWARDS AT 15 METERS PER SECOND·
HOW HIGH WILL IT GO lIN METERS)? 22
NOT EllEN CLOSE.
CORRECT ANSWER IS 11. 47959
HOW LONG UNTIL IT RETURNS (IN SECONDS)' 1
CLOSE ENOUGH
CORRECT ANSWER IS ].861225
WHAT WILL ITS
CORRECT~

10'1 PRINT
105 PRINT
1~36

2 RIGHT OUT OF]

l1e V=5+INT(J5*RND(Q)\

IS THROWN UPWRRDS RT"Y"METEPS PER SECOND"

NOT BAD

METERS~";

GOSI)8 50(t

12f.3 A=V/4. 9

HOW LONG UNTIL IT RETURNS lIN SECONDS)?
CLOSE ENOUGH
CORRECT ANSWER IS 4.285714

122 PRINT "HOW LONG UNTIL IT RETURNS (IN SECONDS)";
124 GOSUB

.5~3~3

lJG T=(1+INT(2*V*RNDil»)/10
11='./-9 8:+:1

4

4

~HAT WILL ITS VELOCITY BE AFTER 2 1 SECONDS? 1
,jOT EVEN CLOSE.
CORRECT RNSWER 15 4200801

PRINT "WHAT WILL ITS VELOCITY 8E RFTEP"T"SECONDS',
GOSUB-

A BALL IS THROWN UPWARDS AT 21 METERS PER SECOND

HOW HIGH WILL IT GO lIN METERS)? 22
CLOSE ENOUGH.
CORRECT ANSWER IS 22.5

11.5 11=',r"2/19.6

116 PR]NT "HOW HIGH WILL IT GO (IN

132
1]4
116
14')

BE AFTER. 2 SECONDS' 11

G~=0

111 PRINT "A BALL
112 PRINT
11~'

VELOCIT~

VERY GOOD!

5~30

PRINT

150 PRINT Q"RIGHT OUT OF
160 IF 0<2 THEN 100
179 PRINT"
NOT BAD
180 GO

TO

2 RIGHT OUT OF.3

500 ltjPUT G
501 G=100*ABS(G-Al
5~32

IF

G<=ABS(FI}

THEN

A
~:;07

503 IF G{=15*AB5(f!) THEN 510
5~36

GO TO
O=G~+l

~,12

15

THROWN UPWARDS AT 22 METERS PER SECOND
24.2

HOW LONG UNTIL IT RETURNS (IN SECONDS)?

508 PRI"CORRECT' VERY GOODI
5139 GI)T0520
5113 PRINT "CLOSE ENOUGH. "
511

BALL

HOW HIGH WILL IT GO (IN METERS)?
CLOSE ENOUGH
CORRECT ANSWER IS 24.69388

504 PRINT "NOT EYEN CLOSE
507

NOT BAD

1(1(1

4.4

CLOSE ENOUGH.

CORRECT ANSWER IS 4.489796

r2=t~+l

WHAT WILL ITS VELOCITY 8E AFTER. 2 SECONDS? 20
CORRECT' VERY GOODI

512 PRINT "CORRECT ANSWER IS"A
5213 PRINT

53') RETURN
999 END

] RIGHT OUT OF].

137

NOT BAD

1:1
!

'~

I

KING

GOVERN YOUR OWN ISLAND

Description
This is one of the more comprehensive, difficult, and interesting
land and resource management games.
(If you've never played one
of these games, start with HMRABI).
In this game, you are Premier of Setats Detinu, a small communist
island 30 by 70 miles long. Your job is to decide upon the
budget of the country and distribute money to your countrymen
from the communal treasury.
The money system is Rallods; each person needs 100 Rallods
per year to survive. Your country's income comes from farm
produce and tourists visiting your magnificent forests, hunting,
fishing, etc. Part of your land is farm land but it also has
an excellent mineral content and may be sold to foreign industry
for strip mining. Industry import and support their own workers.
Crops cost between 10 and 15 Rallods per $quare mile to plant,
cultivate, and harvest. Your goal is to complete an eight-year
term of office without major mishap.
To the question, "HOW MANY TIMES HAVE YOU PLAYED?" answer "0"
for a full set of rules, "500" for no explanation, or "1,000"
to continue an old game. To stop a running game and continue
it later, answer "0" to all questions.
This program is available from DECUS as BASIC-8-346, and is
called "POLLUTION GAME.
II

Program Author
James A. Storer
Lexington High School
Lexington, MA 02173

138

PROGRAM LISTING
REM JIM STORER
PRINT "HOW MANV TIMES HAV~ YOU PLAYED"'
INPUT Z
LET N5'S
6 RANDOMIZE
12 IF Z0500 THEN 47
14 IF Z'I~00 THEN 1960
17 FOR Ylol TO 10
18 PRINT
19 NEXT VI
20 PRINT "CONGRATULHIONSI VOU'VE BEEN ELECTED PRE"IER OF SET US OETINU."
22 PRINT "A SMALL COMMUNIST ISLANO 30 By 70 MILES LONG, YOUR JOB IS TO·
24 PRINT "DECIDE UPON THE COUNTRy' S 8UDGET AND DISTRIBUTE "ONE V TO YOUR.
26 'PRINT ·COUNTRVMEN fROM T"'E COM~UNAL TREASURY,",
27 IF Z00 THEN 47
28 PRINT· THE MONEY SYSTEM IS RALLOOS."
30 PRINT "A'D EACH PERSON NEEDS 100 RAUOOS PER YEAR TO SURVIVE,"
32 PRINT ·YOUR COUNTRY'S INCOME COMES FROM FARM PROllUCE AND TOURISTS"
34 PRINT "VISITING YOUR MAG,'oIFIC!E"T FORESTS. HUNTING. FISHING. ETC, HALF"
36 PRINT "YOUR LANO IS FARM LAND WHICH ALSO HAS AN EXCELLENT MINERAL'
38 PRINT "CO"TE"T HID ~AV BE SOLD TO FOREIGN INDUSTRY CSTRIP MINING)"
39 PRINT .OHO IMPORT AND SU-PORT THEIR OWN .OOKtRS, CROPS COST ~ET.EEN"
40 PRINT "10 ~ND 15 RA~lOOS PER SQ, ~ILE TO p~ANT."
42 PRINT "YOUR GOAL IS TO CuMPLETE YOUR"N51"YEAR TERM OF OFFICE,"I
44 PRINT" GOOD LUCKI"
47 FOR VI-I TO 4
48 PRINT
49 NEXT VI
50 LET AoINT(b"00~+CR'OCllo!0"~)-CRNDCI)01000ll
55 LET SOINTCo0e+CRND(tloI0,-CRNO(lloI0J)
65 LET 00201<\0
100 LET '=INT("NoC1)010+95)
101 FOR Ylol TO 8
102 PRINT
103 NEXT Y1
105 PRINT lIyOU NQW HAVE"IA.JIIRALLODS IN THE TREASURY,II

110 PRINT

INT(8)J"COU~TRV~E~,IIJ

115 LET V90INTC(('''D(t)l2)010+10"
120 IF C•• THEN 140
130 PRINT H~T(C" "FOQEIGN ~ORtlILL BUY LA"'() FO~IIPdIlRALLODS PER SQ, MILE,II
PRINT "LAI'!D CliRREl\jTLY COSTS"'V9'"RALLODS PE;.l SQ. MILE T0 PLANT."
FOR VIol TO J
PRINT
NEXT VI
200 PRINT "HO~ ~A~Y SQ, 111i..t:S DO YOU ~!SH Tn SELL TO INOUSTRYtl,
210 INPUT H
215 IF H<0 THEN 200
22~ IF ~<=D-l~~~ THEN 30~
150
155
160
162
164

230 ~PINT

TIo!IN~

II

240 IF X <>

~

THEN

AGAIN,

YOU'VE ONLyu'O .. 1Cl!0!HIISQ.

MILES OF FA.RM lA,NO"

2~~

250 PRINT "CFUREIGN INDUSTRY "ILL ONLY

auy FA"M LAND BECAuSE fOREST"

260 PRINT "LAr<.iO IS UNE.CONOMICAL TO ST~IP MINE I)UE TO T~EES,u

270
280
299
300
310

PRINT "THICKER TO. SOIL. ETC,)·
LET xa 1
GOTD 2"0
LtT D'I',TCO-H)
LET AoIN"A+CHo.11

320

PRI~T

PHOw

~·,~v

RAL~ODS

00 YOU WISH TO

D!ST~IBUTE

TO YOUR

COUNTRY~E~uJ

340 INPUT I
342 IF 1<0 THEN 320

350 IF I.' 49~1

TIoIIN'" AGAI",. YOU1Ve. ONLY"JA1"RALLOOS LEFT IN TWf. TREASURY"

460 GaTa 410
490 LET Ko~
495 LET . . .
499 GOre-I

100~

500 LET hA-ul

505 IF D~2~~0 TH~N 10~0
510 PRINT "Hna ~ANY ~ALLODS DO YOU
52~ I"PuT K
522 IF M0 THEN lS~2
602 IF 1<>0') TI-IE~ 1"'iZ1 2

604 IF J<>0

~ISH

O~LVIIJAJ"RAlL.Ot'l~

RE,MAIto,;ING"

1~02

IF «'0 T"EN 1102
FOR YIoI TO 5
PRINT
NEXT YI

612 PRI~T "GOOOBVE."
614 PRINT "(H YOU ,oJIStoI Tn CONTHI1jE TI1I5 GAME AT ,. LATER DATE, ANSlliER "
616 PRINT "li>lW'" FOR HOW MANY TI"1E'S YOU'VE PLAYEO, AT 6F.GINNII"JG OF NEXT "_
617 PRINT "GAME.)II
618 GOTO 159.
1000 GOTO 60"
1002 FOR Ylol TO 3
1003 PRI>!T
1004 NEXT VI
1010 LET AoINTCA-K)
1020 LET A40A
1100 IF I'TCI/I~~-B)"0 THE' \120
1105 IF 1/100<50 THE' 1'~0
1110 PRINT INTCH-CI/I10l),'COUNTRVNEN DIED OF ST.RVATION·
1120 LET Fl o INT(RND(I)+C20""-D))
1122 IF K<25 THEN 113~
1125 LET FI.INTCFI/C~/25lJ

ll~: ~~I~i<~~,T.~~0"~~~~E'

DIED OF CARBON-MONOXIDE AND IlUST

INHA~ATION' 139

1150
1160
1165
1170
1112
1174
1115
1176
1180
1181
1182
1183
1185
1181
1189
1190
1194
120~

1220
1224
1226
1230
1250
1255
1260
1265
1270
1275
1280
1290
1292
1305
1310
1320
1324
1326
1330
1340
1344
1350
1355
1360
1365
1367
1370
1380
1390
1400
1405
1410
1420
1425
1430
1435

IF INTCCl/100)-B)<0 THEN 1170
IF FI'0 THEN 1180
GOT a 1200
PRINT'
YOU WERE FOHCEP TO SPENO'IINT(CFI+CB.CII100»).9)1
pRINT 'RALLODS ON FUNERAL EXPENSES,"
~ET 85 01",CFI+CB·CI/100»))
LET ~0INTCA-C(FI+CB-CI/U0lJ).91l
GOTO 1185
PRINT"
YOU wERE FORCED TO S~END·jiNTCFI09l'''RALLODS ON ",
PRINT "FUNERAL EXPENSES,"
LET 850FI
LETA 'INT CA- CF 109»
IF A"0 THEN 1 194
PRINT"
INSUFFICIENT RESERVES TO COVER COST -LAND WAS SOLD"
LET DOINT(O+CA/')l
LET A00
LET soINTCB-85l
IF H00 THEN 1250
LET C!.INTCH+ CRNO (I) 0101- (RND C1l020l)
IF c.~ THEN 1230
LET CloCI+20
PRINT CI''''OR~ERS CA"E TO T"E COUNTRY AND·,
LET P I.INT C( (l/100-B)/10l+ CKI25) - ((2000-DlI50l-(F 1/2) l
PRINT A8S(PIlI"CaUNTRY"EN '"
IF PI<0 THEN 1275
PRINT "CAME TOI!,

GOT a 1280

PRINT "L.EFTII J
PRINT II THE ISLAND."

LET B'rNT ca+PI)
LET C'INT(C+CI)
"ET U2.I,T(((2.00-C)oCCRNOC1)+I.bl/2)1)
IF coe THEN 1324
PRINT" OFlI J INT (J) J "SI~. f1ILES PL_A_NTfO, II J

IF J>lJ2 THEN

1JJ~

~ET U2'J

pRH,if II yoU HAfoiVESTEO",!NTCJ-U2lJ"SQ. MILES OF CROPS."
IF U2=0 T"fN 137"
IF T\>=2 TeEN 1370
P~INT

(UU~

II

TO

u,

IF Tl=0 THEN 1365
PRINT" H.CREASEO '"

PRINT "AIR AND WATER POLLUTION FROM

FOREIG~

INDUSTRY.)"

LET TI.TI+I
LET ,joINHeJ-U210cw/2ll
PRINT II I"iAKll'.jG"IINT(Q)'''RALt..ODS.11
LET ~.IN1(A+Q)
LET V 101 NT( CC8-PI).22)+ CRND (110500»
LET V2.!NTCI2001-D)015)
PRINT 11 YOU MAOE U IAliSC!NT(Vt-V2),"RALLODS FROiJ: TOUqIST TRA.DE."
IF V2.e TH~N 1450
IF VI-V2>'v3 THEN 1450
PRINT"
DECREASE BECAUSE "I
LET Gl'RNO(!)010
144~ IF Gl"2 THEN 1460
1442 IF Gl<.4 THEN 1465
1444 IF GI<'6 THE' 1471
1446 IF GI2~0 TH~N 1600
1505 IF B<343 THE"" 1700

IoU

IF CA4/1io:::I(i'!'>b THi!N

180(7·

1515 IF C.6 THEN 1550
1520 IF N5-1"S THE', 19'30
1545 GOTO 20~"
1tS51il FQR Y1al

1552
1550
1560
1562
156'
1570
157'
1576
1578

a

TO

PRINT
NEXT VI
FOREIG~ WQR(ERS ~AS EXCEEDED THE ~UMBER"
A5 A ~AJORITY THEY HAVE REVOLTFD AND"
THE COUNTRy."
IF P~D(l)<=.b THEN 1b60
PRINT "'(OU HAV~ BE~N T~RU~N OUT OF OFFICE AND YOU ARE NO~II
PRINT "RlSIDING I~ PPISION,"

PRlNT

"T~f

PRINT "OF

PRINT

OF

NUM~ER

COUNTRY~EN.

"TAKE~

OVE~

GOTO 1:;ge

158~

PRINT "YOU

1590
1592
1594
1596
1600
1602
1605
1610
1615
1620
1622
1625
1630
1635
1670
1672
1680
1682
1690
1692
1700
1702
1705
1710
1715
1720
1730
18"0
1805
1807
1810
1815
1820

fOR n ' l TO 18
PRI',T
NEXT Yl
STOP
FOR YI"I TO 8
PRINT
NE, T v I

~AVE

eEtN

ASSASSI~ATED."

PRINT B5J"COU1-JTVRMEN DIED

PRINT
PRINT
~ET

~DUE

nBEE~

TO

T~lS

EXTkE~E

I~PEACHEO

AND

r,,-·

ONE VE.AR1!1""

YOU HAvE NOT GNLV"
OUT OF OFFICE BUT YOU"

MIS~~NAGEME~T

T~Rn~N

"6=1,T(RNDCllOI0)

IF M61 TMEN 270
261 PRINT UII(VX,..·.·,
25a IF XXeX3x TMEN XlI'XX
264 IF XX.X4X THEN X4X'XI
266 IF YXeVlX TMEN V3X-yX
268 IF YX.Y4X THEN V4X-V,1
271 NEXT VI
281 pRINt CHRI,,0XlI
U0 NEXT xx
295 PRINT CHRS(!0X) FOR XX_X21.1 TO 24X
2n PRINT CHRII29S"
299 XI XaX,S, X2X'X", VI X_Y 3SIV2X-V.X
301 IF XIxe3x THEN XIX-lXIIiX'.IX
303 IF xU.UX THEN X2X-22U I9I"U
305 IF y\XeJX THEN yU"3X1 UI'-U
381 IF V2X.68X THEN V2X.eUII9X"U
lag px_ex _
500 FOR XX-XU-I TO X2X+1
SI0 FOR YI,VIX-I TO Y2X+1
Ul Claex
531 FOR IX-XX-,X TO XX.IX
S41 FOR J •• VX_\l TO VX'IX
551 IF AI(U,JX)'U OR AXttx,JX)'U THEN CX-CX.IX
561 NEXT JX
S71 NEXT Ix
5SS IFAX(xx,vx)an THEN 610
590 IF Cxe3. oR CX>4, THEN AX(XX,yx),n E~9E PI-Phi
ee0 GO TO 620
810 IF CX'3X TH!N AXCXX,VXI'lu,xap.-1
628 NEXT VI
631 NtXT xx
6lS XIX-XI l-I,VI UVU-II X2X_nX+I,Y2Xaynol
641 GO TO 210
650 EN~

OENERATI ON: 2

POPULATII;IN: 7

.
. .........

GENERATI ON: 20

POPULATI ON : J:2

. ....... .
.. . .

........
. ...."
.

SAMPLE RUN
ENTER YOUR PATTERN:

... ****
....
..........

....

.

'GENERATION: 21

POPULATI ON: 27

~z

GENERATION: 0

POPULATI ON: :5

.
.. ..... .. .
.......... .. .
.... .... .
. . ....

.........
GENERATI ON: 22

GENERATION: 1

POPULflTI ON: 17

POPULAT ION: G

......
.....

145

.... ....
....
...... ......
*****
. ........ ..... ".
.. .
•• **
....

LIFE-2

2-PERSON GAME OF LIFE

Description
LIFE-2 is based on Conway1s game of Life. You must be familiar
with the rules of LIFE before attempting to play LIFE-2.
There are two players; the game is played on a SxS board and each
player has a symbol to represent his own pieces of Ilife l •
Live
cells belonging to player 1 are represented by 1*1 and live cells
belonging to player 2 are represented by the symbol 1#1.
The # and * are regarded as the same except when deciding whether
to generate a live cell. An empty cell having two 1# 1 and one
1*1 for neighbors will generate a 1#1, i.e. the live cell generated
belongs to the player who has the majority of the 3 live cells
surrounding the empty cell where life is to be generated, e.g.

1

2

4

3

5

1
2

*
#

3

#

4

5

A new cell will be generated at (3,3) which will be a 1#1 since
there are two 1#1 and one 1*1 surrounding. The board will then
become:
1

2

3

4

#

#

1
2
3

4

5

146

5

On the first move each player positions 3 pieces of life on the
board by typing in the co-ordinates of the pieces.
(In the event
of the same cell being chosen by both players that cell is left
empty. )
The board is then adjusted to the next generation .and printed out.
On each subsequent turn each player places one piece on the board,
the object being to annihilate his opponent's pieces. The board
is adjusted for the next generation and printed out after both
players have entered their new piece.
The game continues until one player has no more live pieces. The
computer will then print out the board and declare the winner.
Program Author
The idea for this game, the game itself, and the above write-up
were written by:
Brian Wyvill
Bradford University
Bradford, Yorkshire, England

I.'

I

SAMPLE RUN

PROGRAM LISTING
I DIMNI (6,6),KI ONEXTM
13 DATA-I,e" 1" ........ 1~0.; 1,-1,-1" 1.. ·1"-1,1,,1,, 1
I" FORO I-I TOI6.READAI (01 >oNElITOI
28 GOTOslle
51 FORJ-IT05
51 FORK-ITO!
55· IFNIIJ,K)'99TKE:NGOSUB288
fie NEXTK
65 NEXTJ
98 U:TK_II,LETMI! ••• LETMil-1
99 FORJ-IIT06.PRINT
1811 FORK=n06
11111 IFJ"eTHENIFJ<.6TMENI1I5
lee IFK*6THENPRINTIIJ .GOTO 125
183 PRINTK' .GOTOI 21it
le5 IFK•• ITHENIFK<'6THENlle
106 IFJ*6THENPIlINT8.GOTOI26
117 PRINTJ,.GOTOI28
II II GO SU8311
120 NEXTK
125 NEXTJ
126 RETURN
2lite LETl!Iotl.IFNIIJ,K).999THENLE:TBooI8
2211 FOROI=ITOI5STEP2
2311 LETIII (J+AI (01 ),K..AI (0 1+1 »=NI (J+AI (01 ),K+AI (01+1»)+8
231 NEXTOI
239 RETURN
3ee IFNI(J,K).3THEN399
31S FOROI*ITOI8
310 IFNI (J,K)OKI(OI )THEN351
315 NEXTOI
3211 GOT0399
358 IFO 1'9THEN361
3S1 LE1'Ml (J,K)_." •• LETMS_M2+11 PRINT" * ul
355 RETURN
360 LETNI (J,K)=I.II,LETMa-M3+I.PIlINT"
365 RETURN
399 LETNI (J,K).aIPRINT"
"I.RETURN
5011 PIlINTTA8( I 151' "u.s LIFt GAM!"
5115 LETM2-8.LETMil-II
518 FORJ-IT05
511 FORK=IT05
515 LETNI (J,K)-II
516 NEXTK
51? NEXTJ
~19 FO RB= I TOB. LETPI=3I1FB-eTII~LETPI-3B
528 PRINT"PLAVER"'S,"3 LIVE I>IECU"
535 FORKI-IT03.GOSUS?fllll
54111 LETNI (X(Il),Y(S) I.PI.NEXTKI
5112 NEXTB
559 GOSUS911
568 PRINT.GOSUBSe
5711 IFMe=8TlltNIFM3.B'J'HEN5'II
571 1P'M3••THIilNLETS-I 'GOT0575'
572 IFM2-8THENLETBooa.GOT0575
573 GOT058e

, ",

514 PRINT.J;tRINT"A J)RAWh,RUN

575
588
581
582
586
596
788
785
7116
70a
7111
715
728
7li5
738
,,,.

PRINT I PR·INT."PLAYER", S, "IS , THE WINNER"IRUN
FORS- I TOe, PIUNT. PRINT"PLAYER'" s,.GOSUS1118
IFB099TII£N5611
NEXTS
LETNI (XCI ),Ye I n-III.LETNI (X(el,Y(e) )_·i818
GO TO 5611.:
.
PRINT"X,Y".PRINT"XXXX"'j)HRS( 1.3)) ........ , QHIl.( 1311 INPUTYCB),X(B)
IFX(B).-STtiENIFXCln>IJTHEN7118
00T0758
IFY(S)conHENIFY(S»fIITHEN715
GOT07511
IFNI (X(S)·,V(B»c>fIITHEN1S8
IFBol THENIlETUIIN
IFX( I )=X(2ITllENiF'¥( II_Y(2)TIIEN7"8
RETURN
PIlINT"SAME COORD. ,SET TO ,e"

741 LETNl (X(S)+I .. V(B)'+1 ).'rLETS-99.ftETUfttI'

u.s LIFE GAME
FLAYER I 3 LIVE PIECES
X'Y

........
....
........
X,y

Xi¥

I't.AYEIl 2 3 LIVI;: PIECES
X,Y
X"Y~

....
XiY

8
I .'
2
3
II

*
*
*

5
8
II
I
2
3

"

2

3

"

5

e

,,

I
2
3
4
5

2

3

4

5

e

2

3

"

5

e
I
2
3

* *
*

,

10TO?4
YEA~ YOU'RE A REAL LITERATURE GIANT!
•.
WfiO WAS THE FAIR MAIDEN WHOflTE THE POISON APPLE?
1)SLEEPING BEAUTY, 2)CINDERELLA. i)SNOW WHITE, 4)WENDyn
OH, COME ON NOW ... IT WAS SNOW WHItE.
NOT ·BAD, BUT YOU MIGHT SPEND· A--LITTLE MORE 'T11'1E
READING THl NURSERY GREATS.
READY

150

MATHDI

PICTORIAL ADDITION PRACTICE

Description
I

I
.1

;!

The program presents pictorial drill on addition facts u~ing
printed dice with no reading involved. It is good for beginning
addition, since the answer can be derived from counting spots
on the dice as well as by memorizing math facts or awareness of
number concepts.
It is especially effective run on an alpha-·
numeric CRT terminal.
Program Author
Jim Gerrish
Bernice A. Ray School
Hanover, NH 03755

Illustration by Virginia Nigut,
Scott, Foresman and Co.

151

SAMPLE

PROGRAM LISTING
MATHD

~ATHD

EDUSYSTEM 30

10 REM-MATHDICE*** (BASIC PROGRAM BEGINS AT ~INE 100) WAS PROGRAMMED
11 REM-BY JIM GERRISH, FOURTH GRADE TEACHER AT THE ~ERNICE fI, RAY
12 REM-SCHOOL, HANOVER, NEW HAMPSHIRE,
LAST CHANGE: 3121172,
13 REM
14 REM-PROGRAM PERFORMS PICTORAL DRILL ON ADDITION ,FACTS USING
1~ REM-PRINTED DICE, NO READING INVOLVED,
GOOD FOR BEGINNING
16 REM-ADDITION, SINCE ANSWER CAN I1E DERRIYED FROM COUNTING SPOTS
17 REM-DICE AS wELL AS I1Y MEMORIZING MATH FACTS OR AWARENESS
18 REM-OF NUMI1ER CONCEPTS,
19 REM29 PRINT'THIS PROGRAM GENERATES SUCCESSIVE PICTURES OF TWO DICE,
21 PRINT"WHEN TWO DICE AND AN EQUAL SIGN FOLLOWED 8Y A QUESTION'
22 PRINT"MARK HAVE SEEN PRINTED, TYPE YOUR ANSWER AND THE RETURN KEY,
23 PRINT'TO CONCLUDE 'THE LESSON, TYPE CTRLIC AS YOUR ANSWER,'
24 PRINT
25 PRINT
108 RANDOMI~E
105 LET N=N+1
119 LET D=INT(RND(0)*6+1)
120 PRINT ", ----~ "
130 IF 0.1 THEN 200
140 IF 0=2 THEN 1S0
150 IF 0=3 THEN 180
169 PRINT "J ... * I"
179 GO TO 210
180 PRINT "I'"

190
290
219
220
230
249
258
260
265

270
2Se
290
300
310
320

JJ0
340

350
360
370
375

GOTO 210
PRINT "I
I"
IF 0-2 THEN 260
IF 0=4 THEN 260
IF D=6 THEN 270
PRINT "I
I"
GOTO 280
PRINT "I
I"
GOTO 280
PRINT "I • • I"
IF 0=1 THEN 350
IF D=2 THEN 330
IF 0=3 THEN 330
PRINT "I • • I"
GOTO 360
PRINT "I
• I"
GO TO 360
PRINT "I
I"
PRINT ", -----, "
PRINT
IF N=2 THEN 500

380 PRINT"

30

I'
I
I

I
•

I
I

III

?3

RIGHT!
THE DICE ROLL AGAIN"",
J

I
l*,oll I

I •
I
I

*

I

17

NO, COUNT THE SPOTS AND GIVE ANOTHER ANSWER,
= ?5

NO, THE ANSWER IS
THE DICE ROLL

6

AGAI~

] ..... I
I
•
I

.... "

3S1
400
410
580

PRINT
LET A=D
GOTO 100
LET T=D+A

520
530
540
541
550
560
570
5S0
590
600
601
610
615
620
900

INPUT T1
IF 11=T THEN 590
PRINT "NO, COUNT THE SPOTS AND GIYE ANOTHER ANSWER. "
PRINT"
= ";
INPUT T2
IF T2=T THEN 590
PRINT "NO, THE ANSWER IS ", T
GOTO 690
PRINT "RIGHT!"
PRINT
PRINT "THE DICE ROL,~ AGAIN"." •
PRINT
LET N=0
GOTO 100
END

510 PRINT "

EDUSYSTE~

THIS PROGRAM GENERATES SUCCESSIVE PICTURES OF TWO ,DICE,
WHEN TWO DICE AND AN EQUAL SIGN FOL~OWED BY fI QUESTION
MARK HAYE I1EEN PRINTED, TYPE YOVR ANSWER AND THE RETURN KEY,
lO CONCLUDE THE LESSON, TYPE CTRL/e AS YOUR ANSWER,

I.....
]

I"

'RUN

I •• I

=

~;

I ••
I
I

*

I ...

I

19

RIGHT!
THE DICE
I'

I

*

I

READY

RO~L

AGAIN.

I
I
I

=

73:

RIGHT!
lHi DICE ROLL AGAIN"
I
I

.* .. t
•

I

I.
I
I

I
I
I

*

RI~HT!

152

I

] *' . .

'" 77

MNOPLY

GAME OF MONOPOLY

Description
MNOPLY is a simulation of the most popular board game in the
world, Monopoly. It varies from the actual game only in that
two players are the maximum number that can play.
The dialog during the game presents complete rules and instructions. The inputs are designed so that when anything except the
required input is typed in, the entire segment will be ignored.
When questions are asked about property to be sold, the full
name is required--e.g., STATES AVENUE.
In the computer game, you always pay $50 to get out of jail
unless you have a "GET OUT OF JAIL FREE" card. No double rolls.
As in the board game, before you can improve your property
(build houses), you must own all of the pieces of that color
property--i.e., have a monopoly of a particular color group.
The program will automatically ignore attempts to build houses
if you don't have a color group monopoly. Here are the color
groups for your reference:
Purple:
BALTIC AVE
MEDITERRANEAN AVE
Light Blue:
ORIENTAL AVE
VERMONT AVE
CONNECTICUT AVE
Maroon:
ST. CHARLES PL
STATES AVE
VIRGINIA AVE
Orange:
ST. JAMES PL
TENNESSEE AVE
NEW YORK AVE

Red:
KENTUCKY AVE
INDIANA AVE
ILLINOIS AVE
Yellow:
ATLANTIC AVE
VENTNOR AVE
MARVIN GARDENS
Green:
PACIFIC AVE
NORTH CAROLINA AVE
PENNSYLVANIA AVE
Dark Blue:
PARK PL
BOARDWALK

Computer Limitations
MNOPLY was written for DIGITAL RSTS-ll or RSTS/E.
It requires
two virtual memory files which are built via the file-building
program.
Source
David Barker
Southeastern State College
Durant, OK 74701

153

PROGRAM LISTING
TH! ~O~~OWIN' PROGR.M U DUUNED TD BUl~D THE DUK 'I~U
NUDED TO P~AY MONOPQ~ y, TWO P I~U Mun I! 8Ul~ T, THI 'I~n
CONTlIN%N~ THE NAHU OF THE PROPERTY, TH! SO~D AND UNao~o
F~AG', THI PRIcn OF THE PROPUTV, .ND THEIR RINTS,
TH! neOND nLE CONTAINS THE CH'NC! AND TH! COMMUNITY
CHIST MUSAGES .ND THE INSTRUCTION MESSAGES FOR THE
P~AYERS,
THE DATA POR THUI Ft~U WIL~ BE READ FROM THE
PROGR.M WHEN IT II RUN, TM!n PILlS MUST 8E BUILT nFORE THE
9 I GAME CAN IE PLAYED
10 OPEN 'PRPRTV' AI Fl~E II DIM .1,UI41X)'U,~X(4" ,P(411) ,RI40X)
30 OPEN "MESAJ" AS FILE 31 DIM n,CIIU)"'X,ZlClUoeU,MSC2e).5U
40 FOR III TO 40
42 RUD Gsc%),~X(l),PCl"RCI)
44 NEXT I
sa FOR hi TO 20
sa RUD Macll
54 NEXT I
ee FOR 1 0 1 TO U
U RUD CI(1)
U NEXT I
70 FOR 101 TO U
72 RUD ZlC!)
,. NUT I
10B DATA 'MEDtTUR.NUN AVIINU,",I,U,2
10a OATA 'COMMUNITY CHEST',"',0
104 DATA 'BALTIC AVENUE',.,U,4
ua DATA "INCOME TAX",e,B,B
108 DATA 'REAOING R'ILROAO",I,ne,n
III DATA "DRIENT'L .VENUE"',10a,a
112 P.TA 'CHANCE '.,e,0,'
114 DATA 'VlRMONT AVENUE',',IIB,a
118 P'TA 'CONNECTICUT AVINUE",I,IU,a
118 D.TA ·VlSlTINij IN JAl~',a,a,0
120 DATA '8T.CHAA~U PL,CE',0r141,!'
122 DATA "E~ECTRIC COMP.NY',0r1U,J.
124 OAT. 'IUTU .ViNue',0,j40r1e
12a D.TA 'VIRGINIA .VENUE'.0. lee, 12
128 PATA "PENN8V~V'NU R4I~ROAO,,1.2B0.25
13B PATA 'n,JAMES P~'C!',0,IUrl4
132 DATA "COMMUNITY CHUTN,I,e,1
lU DATA "T£NNUIE! AVENUE",lrlBerl4
US DATA "NEW YORK AVENUE",0,UI,!6
138 DATA 'FREE PARKIN~.,.,1.0
140 DATA 'KENTUCKY AVENUe",1,2n,1S
142 DATA "CHANCE 1',0,a,0
144 DATA 'INPIANA AVENUe",1,2U, It
146 DATA 'I~LINOU AHNUI' ,1,240,za
148 DATA "B,& 0, RAI~ROAD,,0,201,25
151 DATA 'AT~'NTIC .VENue',0,ae0,2a
152 DATA 'VENTNOR AVENUE', I, ae" 22
184 DATA 'WATIR WORKS',.,IIII,U
151 OAT. 'MARVIN G.ROENS.,0,2U,U
lse DATA 'GO TO JAI~',0,1,0
168 DATA 'PACIFIC AVENUE",a,300,26
182 DATA 'NORTH CARD~INA AVENUE',0,301,2a
IU DATA "COMMUNITY CHUT",a,I,1
168 D.TA 'PENNSY~VANU AVENUE".0,321,28
188 DATA -SHORT ~INE.,0,200,25
171 DnA "CHANCE '",0,0,0
172 PATA "PARK P~ACE",0,350,J5
174 DATA "LUXURy TAX',0,1,0
176 DATA "BOARDW'LK',I,400,50
178 DATA "GO',0,I,0
200 DATA .............. THIS IS M4T~IO.'S MONOPOLY FOR TWO ............. .
202 DATA '(ACM ~LAYER MAS S1510'
204 OATA "WHEN YOU 8UY HOUS!S YOU H.VE TO PUT THE UME"
286 OAT. 'NUMBER ON EACH MEMBER OF A COLOR GROUP"
a08 D'TA "WHEN YOU BUY HOUSU INPUT THE NUMBER YOU WANT PER LOT"
21B D.TA 'TO ROLL DICE TYPE ROLL"
212 D.TA 'IT IS FOR SA~E FO_ ON~Y"
21~ DATA "IF YOU WISH TO BUY IT TYPE BUY'
21a DATA -YOU RO~~ED DOUBLI8 •• ROL~ .GAIN"
211 PATA 'YOU ROLLEO J SUI OF DOU8LU"GO TO JAIL"
220 DATA "If YOU WANT TO QUIT TYPE QUIT'
322 DATA 'YOU ALREADY OWN THIS PIECE Of PROPERTY'
224 DATA 'IF THERIL IS 'NY PROPERTY YOU WISH TO SEL~ AND"
22a OAT. 'YOUR OPPONENT WANTS TO BUY TYPE SE~~"
a28 DATA "IF yOU NEED A LIST OF PROPERTY TYPE ~IST'
230 DATA 'YOU CAN'T SE~L THIS •• YOU DON'T OWN IT"
al2 D.TA 'WH'T PROPERTY DO YOU WANT TO SEL~"
a:J4 DATA 'IF TH!U IS ANY MORE PROPERTY YOU WISH TO SE~~ TYPE YU'
2U O.TA 'XF YOU W.NT TO IMPROVE YOUR PROPERTY TYPE HOU8['
U8 DATA 'YOU DON'T HAVE ENOUGH MONEY FOR THAT MANY HOUSES"
250 DATA 'PAY POOR TAX OF Sle"
252 DATA "ADVANCE TOKEN TO I~LINOIS .VENUE'
254 D.TA 'GO SACK THREE SP.CU'
256 DUA ".PVANCE TO GO'
2118 OUA "BANK P'YS YOU DIVIDEND OF 550"
2U DATA 'TA~! • RIDE ON THE 'READING"
262 DATA "GO TO JAIL"
284 DATA "BUILDING .ND ~OAN MATURE8"C'OL~ECT '160'
266 DUA -AOV.NCE TO 80'RDWA~K"
268 DATA "DVANCE TOST ,CHARLES P~ACE'
180 DATA '.MAI FUND MATURU.'CO~LECT Hn282 DATA "LIP!! INSURANCE MUURU'.COLUCT IU.284 D.TA 'l~COMi TAX R£FUNO"COL~£CT 120'
2U DATA 'POCTOR'S FEE .. PAY 550"
288 PATA 'YOU INHERIT 1100'
ag0 DATA 'AOVANCE TO GO'
aV2 D.T. 'PAY HOSPITA~ 'lee'
294 DATA 'GO TO JAl~"
296 DATA 'PAV SCHOOL TA. OF 15'"
298 DATA 'UNK ERROR IN YOUR FAVOR .. CDLLECT S200'
3e0 C~08E 1,31
END
,
I
)
4
5
a
7
a

154

I I MONOPOLY GAME ay DAVID"~"ER,'OUTHI"T!RN tUTI CDL~U!,OUR.NT, OK
2' I ILIGHT PRoaRAM.MODIFICUIONSBY D.VID AHL, DIGITAL
l MCI). M(2) ,,!lUX I I CI), I C2,"0101/11 AI (25), sa 125." HXC48,
, OPEN -PR~RTY' A8.FILI II DIM *',Gt(4I1Ulas,LXI41),'HU),RC4U)
8 FOR. 1.11 TO lhLXCI),HXCOo',NEXT IIFOR %01 TO IIUCU.I'I;!XT I
9 DEF FNRIIHXClCZ».RCICZ)hIU)
U OPEN "H!SAJ" AS Fl~! 31 DIH n,CSCU).sn,ZlCl0l08n,HIC2I)ISU
15, MI(I)I&I&I& - .. RULU."" MII2)I& Hlll)1& MI(4),& H1(5)
38 INPUT"WHO 18 PL.YER U"'NICllI INPUT"WMO IS P~AVIR .. ",Ns(2)
100 PRINTI PRINT ' •• 'NICI)"S TURN ........... I
F.,
li2 I'UI GOSUB luel GOlUB 2000
115.IF PIDI THEN F".II IF FCJ THEN PRINT MIC911 GOTO 102
117 IF '13 THIN PRINT HICU), lC%).UI H(I)oH(I)-SIX
20e PRINTI PRINT - •• -NI(2)'IS TURN ••••••••••• I
"e
au ZIUI aOSUB 10011 GOlUB 2000
215 IF 0101 TIiEN F.'OIl IF .FcJ TMiN PRINT MIC9I1 GOTD 2U
a11 IF FI3 THEN PRINT MI(U)I HUIUI HCZ).MCZ)-ell
228 PRINT MI(lI)IIINPUT FSlIF ""Qun" THEN 301Be ELSE U0
un PRINT MI(6)IIINPUT FSI RANOOMIU, XIRNOII)I YIRND(0) IDICE ROLL
IU2 IF X"aAND X, 48 AND Xeo, 54 T~£N D'~
1106 IF ._,U AND X•• ,81 THIN Dol
1007 1~ •• ,'I .ND xeo I TKEN 016
101g IF Y".0 AND Yu,lI THlN 011\
IBU IF Ya,lI AND YCI,32 THEN 0112
1811 l ' n,ll AND Y",AS THEN OI,J
UI2 IF V_,48 AND Y",64 THiN DIH
IfIIIJ IF Y-,U AND YU,SI THIN DIOS
ISI~ IF Va,BI AND Yeol THEN 0106
1015 PRINT 'YOU ROLLED A"D'AND A'DIlIeZ).l A 1·
YOU ARE ON NEW ·YORK 'AYENUE
IT 15 FOR SALE FOR ONLY 200 DOLLARS
IF YOU WISH TO BUY IT TYPE BUY? BUY
YOU NOW HAYE 1200 DOLLARS
IF THERE IS ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
IF VOU WANT TO IMPROYE YOUR PROPERTY TYPE HOUSE?
IF .YOU WANT TO QU I T TYPE QU IT?

**DAVE"' S TURN**********
TO ROLL· DICE TYPE ROLL? ·ROLL
YOU ROLLED A 3 AND A 4
YOU ARE ON NEW YORK AVENUE
VOU OWE 16 DOLLARS RENT
**SANDy . . S . TURN"'**"'*"''''*''''''
TO ROLL DICE TYPE ROLL? ROLL
VOU ROLLED A 6 AND A 4 .
YOU ARE .ON MARYIN GARDENS
IT 15 FOR SALE FOR ONLY 2se DOLLARS
IF YOU WISH TO BUY IT TYPE BUY? BUY
YOU NOW HAVE 936 DOLLARS
rF THERE IS ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
IF YOU WANT TO rMPROVE' YOUR PROPERTY TYPE HOUSE?
IF YOU WANT TO QUIT TYPE QUIT?

**D'AVE'" S TURN**********
TO ROLL·DICE TYPE ROLL? ROLL
·YOU ROLLED A 4· .AND II 5
YOU ARE ON WATER WORKS
IT IS FOR SALE FOR ONLY 150 DOLLARS
IF YOU WISH TO BUY IT TYPE BUY?
IF THERE 15 ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
IF YOU WANT TO IMPROVE YOUR PROPERTY TYPE HOU~E?

SI •• ' PRINT NIII)" OWNED TilE FOI.LOWING PRIlPERTY'

.
"OR 101 TO CIPRXNT At(IIINIiXT I
J8I18 PRr"'T'AND MAD"IMIIII"DOI.LARS AT THE END D' THE UH!'
11811 PRINT NI (2)' OWNED THI FOLLDWI"'G P~D"RTY"
I'OR J'I TO D,PRINT 81(1) INUT I

3•• 12 PRINT "AND HADa'MIa)I'OOLLARS AT THI·END 0' THE GAME.

3een

."'DAVE" 5 TURN •••••• ", •••

TO ~OLL· DICE .TYPE ROLL? ROLL
YOU ROLLED· A ~ A.ND A 4
VOU fIRE ON GO TO JAIL

CLOn 1,31 END

*"'SANDY" S .TURN**"'*.*"'**"'*
TO ROLL DICE TYPE ROLL? ROLL
YOU ROLLED A 6 AND A :I.
VOU ARE ON CHANCE ?
ADVANCE TOKEN TO ILLINOIS AYENUE
YOU ARE ON ILLINOIS AVENUE
YOU OWE 20 DOLLARS RENT
IF YOU WANT TO QUIT TYPE QUIT?

**()AYE"S TURN","'",,,,,,,,,,,,,*,,,,,,

SAMPLE RUN

TO ROLL DICE T~PE ReLL? ROLL
YOU ROLLED A l AND A 6
YOU ARE ON PARK PLACE
IT IS FOR SALE FOR ONLY l50 DOLLARS
IF YOU WISH TO BUY IT TYPE BUY? BUY
YOU NOW HAVE 574 DOLLARS
I F THERE I S ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
IF YOU WANT TO IMPROVE YOUR PROPERTY T·YPE HOUSE?

RUN MONPLY

*************THIS IS

MATLIDA~S

MONOPOLY FOR TWO*************

**RlILES**
EACH PLAYER HAS $1598
WHEN VOU BUY HOUSES YOU HAVE TO PUT THE SAME
NUMBER ON EACH MEMBER OF A COLOR GROUP
WHEN YOU BUY HOUSES INPUT THE NUMBER YOU WANT PER LOT
WHO IS PLAYER i1? DAYE
WHO IS PLAYER .2? SANDY

*"'SANDY .. S TURN"'''''''*'''''''''''''''*

TO ROLL DICE TYPE ROLL? ROLL
YOU ROLLED A 6 AND A 2
YOU ARE ON NORTH CAROLINA AVENUE
IT IS FOR SALE FOR ONLY 300 DOLLARS
IF YOU WISH TO BUV IT TYPE BUY? BUY
YOU NOW HAVE 636 DOLLARS
IF THERE IS ANY PROPERTY YOU WISH TO SELL AND
~'OUR OPPONENT WANTS TO BUY TYPE SELL?
I F ~'OU WANT TO I MPROVE YOUR PROPERTY TYPE HOUSE?
IF YOU WANT TO QUIT TYPE QUIT?

**DA't'E-' S TURN**********
TO ROLL DICE TYPE ROLL.? ROLL
YOU ROLLED A 6 AND A 1
VOU ARE ON CHANCE ?
ADYANCE TOKEN TO ILLINO[S AVENUE
YOU ARE ON I LLI NO I 5 AVENUE
IT IS FOR SALE FOR ONLY.240 DOLLARS
[F VOU WISH TO BUY IT TYPE BUV? BUV
YOU NOW HAVE 1269 DOLLARS
IF THERE [S ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
I F YOU WANT TO I MPROYE YOUR PROPERTY TYPE HOUSE?

**DA~E'S

**SANDY"'S TURN*****"''''***
TO ROLL D[CE TYPE ROLL? ROLL
YOU ROLLED A 2 AND A 4
YOU ARE ON OR I ENTAL AYENUE
[T 15 FOR SALE FOR ONLY 199 DOLLARS
IF YOU WISH TO BUY IT TYPE BUY? BUY
YOU NOW HAVE 1400 DOLLARS
[F THERE IS ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY, TYPE SELL?
IF ·YOUWAN:( TO IMPROYE YOUR PROPERTY TYPE HOUSE?
IF YOU WAN1'"t,0 .QUIT TY~E QUrT? .
.

:t;:lkSANDY'.S TURN**********
TO ROLL I) I CE TYPE ROLL? ROLL
YOU ROLLED A 1 AND A Ii
YOU ARE ON BOARDWALK
IT is" FOR· SALE FOR ONLY 408 DOLLARS
IF ··You: UISH· TO BUY IT TYPE BUY? BUY
YOU NOW HAilE; 236 DOLLARS
I F· THERE I S ANY PROPERTY YOU WISH· TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
1F YOU WRNT TO IMPROYE YOUR PROPERTY TYPE HOUSE?
IF YOU WANT· To QUIT TYPE QUIT?

**DAYE" S TURN**"'*******

TO ROLL DICE TYPE ROLL ?.;t~OLL
YOU ROLLED A 3 AND A 3 .,
YOU ARE ON GO TO JAIL
VOU ROLLED DOUBLES**ROLL AGA I N
TO ROLL DICE TYPE ROLL? ROLL
YOU ROLLED A 6 AND A 5
YOU ARE ON KENTUCKY AVENUE
IT I S FOR SALE FOR ONLY 220 DOLLARS
IF YOU WISH TO BUY IT TYPE BUY? BUY
YOU NOW HAilE 990 DOLLARS
IF THERE IS ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
I F. YOU WANT TO I MPROVE YOUR PROPERTY TYPE HOUSE?

**DAYE'" S :fURN**********
TO ROLL I) JOE· TYPE ROLL? ROLL
YOU ROLLE!> A '2 AND A 5
you ARE ON YISITING IN JAIL

**SANDyLS TVRN**********

**SANDY'S TURN"'**"''''*''''''*'''

TO ROLL DICE TYPE ROLL? ROLL
YOU ROLLED A 1 AND A 5
YOU ARE ON ELECTRIC COMPANY
...
IT 15 FOR SALE FOR ONLY 150 DoL~IIRS
I F YOU WISH TO BUV IT TYPE BUY? .. •
.
IF THERE IS ANY PROPERTY ~'OU WISH Ttl'SELl:' ANDYOUR OPPONENT WANTS TO BUY TYPE SELL?
IF YOU WANT TO I"PROIIE YOUR PROPERTY TYPE HOUSE?
IF YOU WANT TO QUIT TYPE QUIT?

TURN**********

TO ROLL DICE TYPE ROLL? ROLL
YOj.! ROLLED A 5 AND A 1
VOU ARE ON BALTIC AVENUE
1T:15 FOR SALE FOR ONLY 60 DOLLARS
IF YOU WISH TO BUY IT TYPE BUY?
IF HIERE IS ANY PROPERTY YOU WISH TO SELL AND
~'OUR OPPONENT WANTS TO BU~' TYPE SELL?
IF YOU WANT TO IMPROYE YOUR PROPERTY TYPE HOUSE?

155

TO . ROLL 0 I CE T.YPE ROLL? ROLL
YOU ROLLED A 6.AND A 6
.YOU ARE ON ST. CHARLES PLRCE
·IT IS FOR SALE FOR ONLY 140 DOLLARS
IF YOU WISM TO BUY IT TYPE BUY? BUY
YOU NOW HRYE 296 DOLLARS
IF THERE IS ANY PROPERTY YOU WISH TO SELL AND
YOUR OPPONENT WANTS TO BUY TYPE SELL?
·1 F YOU WANT TO I MPROYE YOUR PROPERTY TYPE HOUSE?
YOU ROLLED DOUBLES**ROLL AGRIN
TO ROLL DICE T'r'PE ROLL? ROLL
YOU ROLLED A 5 AND A 5
YOU ARE ON KENTUCKY AVENUE
YOU OWE 18 DOLLARS RENT

MUGWMPFIND

4 MUGWUMPS IN HIDING

Description
Your objective in this game is to find the four Mugwumps hiding
on various squares of a 10 by 10 grid. Homebase (lower left) is
position (0,0) and a guess is a pair of whole numbers (0 to 9),
separated by commas. The first number is the number of units
to the right of homebase and the secondnurnber is the distance
above homebase.
You get ten guesses to locate the four MUgwurnps~ after each guess,
the computer tells you how close you are to each MUgwurnp. Playing the game with the aid of graph paper and a compass should
allow you to find all the Mugwumps in six or seven moves using
triangulation--i.e., like LORAN radio navigation.
Source
This program was modified slightly by Bob Albrecht of People's
Computer Company. The original source were students of:
Bud Valenti
Project SOLO
University of Pittsburgh
Pittsburgh, PA 15213

IlUGWu'"r 1

.",
156

PROGRAM LISTING

SAMPLE RUN

1 REM COURTESY OF PEOP~E' S COMPUTER COMPANY
2 REM MUGWMP
3 REM
CONVERTED TO RSTS/E BY DAV ID AHL, DIG I TAL
5 RANDOMIZE
'
'
10 DIM 1'(4,2)
20, PRINT "THE OBJECT OF THIS GAME IS TO F"lND FOUR MUGWUMPS"
30 PRINT "HIDDEN ON A 10 BY 19 GRID. HOMEBASE IS POSITION 9,0"
40 PRINT "ANY GUESS YOU MAKE MUST BE TWO NUMBERS WITH EACH"
50 PRINT "NUMBER BETWEEN 9 AND 9; INCLUSIVE. FIRST NUMBER"
60 PRINT "IS DISTANCE TO RIGH,T OF HOI'IEBASE AND SECOND NUMBER"
79 PRINT "IS DISTANCE ABOVE HOI'IEBASE. "
'
SEt PRINT
90 PR I NT "YOu., GET 10 Tit< I ES. AFTER EACH TRY, I WILL TELL"
:Lee PRINT "YOU HOW FAR YOU RRE FROM EACH MUGWUMP. "
:1.10 PRINT
2413 GOSUB 100e
250 T=0
269 T=T+l
270 PRINT
275 PRINT
290 PRINT "TURN NO. "T; "WHAT IS YOUR GUESS";
30e
INPUT M. N
31e FOR 1=1 TO 4
320 IF P ( I, 1)=-1 THEN 4011
330 IF P(I,1)(:>M THEN 3S9
340 IF P( I, 2){)N THEN 3811
3501'(1,1)=-1
360 PRI NT "YOU HAYE FOUND MUGWUMP"; I
370 GOTO 400
380 O=SQR( (P( I, 1)-M)~2+(P( I, 2)-N)~:2)
399 PRINT "YOU ARE"INHD*1ID/10"UNITS FROM MUGWUMP"I
409 NEXT I
410 FOR J=1 TO, 4
429 I'F P(J, :L)()-1 THEN 470
430 NEXT J
440 PRINl
450 PRINT "YOU GOT THEM ALL IN";T;"TURNS!"
46e GO TO 5SB
470
IF T<10 THEN 260
480 PRINT
4S10 PRINT "SORRY, THAT)S 10 TRIES. HERE IS WHERE THEY'RE HIDING"
540 FOR 1=1 TO 4
550 IF P(I,1>=-1 THEN 570
568 PRINT "MUGWUMP";!; "IS AT (";P(!,1); ", ";1'<1,2); ")"

THE OBJECT OF THIS GAME IS TO FIND FOUR MUGWUMPS
HIDDEN ON A 10 BY 11" GR I D. HOME BASE IS POSI TI ON 0, It
AN~ GUESS YOU MAKE MUST BE TWO NUMBERS, WITH EACH
NUMBER BETWEEN 1/1 AND 9, INCLUSIVE. FIRST NUMBER
IS DISTANCE TO RIGHT OF HOMEBASE AND SECOND NUMBER
IS DISTANCE ABOVE HOME BASE.

570

TlIRN NO. 6 WHAT IS YOUR GUESS? 1, 0
¥OU HA~E FOUND MUGWUMP :1.

***

NEXT I

680 PRINT
600 PRINT "THAT WAS' FUN!
LET'S PLAY AGAIN.
610 PRINT "FOUR MORE MUGMUMPS ARE NOW IN HIDING. "
630 GOTO 240
1000 FOR J=1 TO 2
1010 FOR I =1 TO 4
1020 f'( I, J)=INTo.0*RNl)(0»
1038 NEXT I
1040 NEXT J
1050 RETURN
:l.9S1l1 END
READY

~'Ol)
~OIJ

GET 10 TR I ES. AFTER EACH TRY, I WILL TELL
HOW FAR YOU ARE FROM EACH MUGWUMP.

TURN NO.
~OU ARE
~'OU ARE
~'OU ARE
~OU ARE
TllRN NO.
~OU ARE
YOU ARE
~'OU ARE
YOU ARE

:I. WHAT I S ,,"OUR GUESS? 5, 5
6. 4 UN ITS FROM MUGWUMP 1
1. 4 UN ITS FROM MUGWUMP 2
2. 2 UN ITS FROM MUGWUMP 3

1. 4 UNITS FROM MUGWUMP, 4
:2 WHAT

IS YOUR GUESS?' 4, 4

5 UN ITS FROM MUGWUMP 1
2 UN ITS FROM MUGWUMP 2
:I. UN ITS FROM MUGWUMP 3
2. S UNITS FROM MUGWUMP 4

TURN NO. 3 WHAT IS YOUR GUESS? 6,6
YOU ARE 7. S UN liS FROM MUGWUMP :1.
YOU ARE 2 UN I TS FROM MUGWUMP 2
~OU ARE 3. 6 UNITS FROM MUGWUMP 3
YtliJ HAVE FOUND MUGWUMP 4
TlIRN NO. 4 WHAT I S YOUR GUESS? 4, 6
~OU ARE 6. 7 UN I TS FROM MUGW.\JMP 1
¥OU HAYE FOUND MUGWUMP 2
YOU ARE 2. 2 UNITS FROM MUGWUMP 3
TURN NO. 5 WHAT IS YOUR GUESS? 3,4
ARE 4. 4 UNITS FROM MUGWUMP :1.
~OU HAYE FOUND MUGWUMP 3

~'OU

¥OU GOT THEM ALL IN 6 TURNS!
THAT WAS FUN!
LET'S PLAY AGA I N...
FOUR MORE MUGMUMPS ARE NOW I ill HID I NG.
TURN NO. :1. "'HAT 15 YOUR GUESS?
~ou RRE 2. e UN I TS FROM MUGWUMP
YOU ARE'4. 4 UNITS FROM MUGWUMP
" ~'OU ARE 5.3 ,UNITS FROM MUGWUMP
YOU ARE ,5 UN ITS FROM MUGWUMP 4

4,4
1
2
3

TURN NO .. 2 WHAT I S YOUR GUESS? 2, 2
YOU ARE 5. 6 UN ns FROM MUGWUMP 1
YOU ARE 2' UNITS FROM' 'MUGWUMP 2
~OU ARE 7 UJ\l1T5' FROM MUGWUMP 3
\'OU ARE, 7.:i 'UN ITS FROM MUGWUMP 4
TURN NO. 3 WHAT I S YOUR GUESS? 6, 6
YOU HAYE FOUND MUGWUMP :1.
YOU ARE 7. 2 UN I T5 FROM MUGWUMP :;:
YOU ARE 5 UN ITS FROM MUGWUMP 3
~OU ARE 3. 6 UN ITS FROM MUGWUMP 4
TURN NO. 4 WHAT I S YOUR GUESS? 0, 2
YOU HAVE FOUND MUGWUMP 2
YOU ARE 9 UN I TS FROM MUGWUMP 3
YOU ARE S UNITS FROM MUGWUMP 4
TURN NO. :; WHAT IS ,'OUR GUESS? 4,9
YOU ARE S. 6 UN ITS FROM MUGWUMP 3
YOU HAYE FOUND MuaWUMP 4
TURN NO. 6 WHAT IS YOUR GUESS? 9,2
Y(/U" HAVE ·,F.OUND MUGWUMP 3.
YOU GOT THEMA~I- IN ii TURNS!

NICOMA

COMPUTER GUESSES YOUR NUMBER

Description
One of the most ancient forms of arithmetical puzzle is somet.imes
referred to as a "boomerang." At some time, everyone has been
asked to "think of a number I " and, after going through some
process of private calculation, to state the result, after which
the questioner promptly tells you the number you originally
thought of.' . There are hundreds of varieties of the puzzle.
The oldest recorded example appears to be that given in Arithmetica
of Nicomachus, who died about the year 120. He tells you to
think of any whole number between 1 and 100 and divide it successively by 3, 5, and 7, telling him the remainder in each case.
On receiving this information, he prompt+y discloses the number
you thought of •
Can you discover a simple method of mentally performing this feat?
If not, you can see how the ancient matheinatician did it by looking at Lines 80-100 of the program.
Program Author
Digital Equipment Corp.
Maynard, MA 01754

158

PROGRAM LISTING
10 PRINT "BOOMERANG PUZZLE FROM ARITHMETICA OF NICOMACHUS -- A. D.
29 PRINT
30 PRINT "PLEASE THINK OF A NUMBER BETWEEN 1 AND 100. '
48 PRINT "YOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF",
45 INPUT A
59 PRINT "YOUR NUMBER I>II,'IDED BY 5 HAS A REMAINDER OF',
55 INPUT B
60 'PRINT "YOUR NUMBER DIVIDED BY 7 HAS A REMAINDER OF",
65 INPUT C .
79 PRINT
80 PRINT "LET ME THINK A MOMENT.
90SLEEP(5).
199. 1)?70*A+21*B.+15*C
110 IF D<=105 THEN 140
120 D=D-105
130 GOTO 110
140 PRINT
150 PRINT "YOUR NUMBER WAS"D", RIGHT";
160 INPUT A$
165 PRINT
170 IF A$="YES" THEN 220·
180 IF A$="NO" THEN 240
198 PRINT "EH?
I DON'T UNDERSTAND' "A$"'
TR~"
YES' OR 'NO'"
200 GOTO 150
228 PRINT "HOW ABOUT THAT!!"
230 GOTO 250
240 PRINT "I FEAR ...OUR ARITHMETIC IS IN ERROR. "
250 PRINT
260 .PRINT "LET'S TRI' ·ANOTHER. "
270 GOT a 20
999 END

SAMPLE RUN
BOOMERANG PUZZLE FROM ARITHMETICFi OF NICOMACHUS -- A. D.
PLEASE THINK. OF A NUMBER
YOUR NUMBER DIVIDED 81' 3
YOUR NUMBER DI VIDED B", 5
YOUR NUMBER DIVIDED B... 7

BETWEEN 1 AND 100.
HAS A REMAINDER OF ?3
HAS A REMAINDER OF 70
HAS A REMAINDER OF 75

loET ME THINK A MOMENT.
YOUR NUMBER WAS '75 ,RIGHT ?RIGHT
EH?
I DON'T UNDERSTAND; RIGHT'.
YOUR NUMBER WAS 75 , RIGHT· ?~'ES

TRY' "'ES' OR 'NO'

HOW ABOUT THAT!!
LET'S TRY ANOTHER.
PLEASE TH I NK OF A NUMBER
YOUR NUMBER DIVIDED. BY 3
YOUR NUMBER DIVIDED BY 5
YOUR NUMBER DIVIDED BY 7

BETWEEN 1 AND 100.
HAS A REMAINDER OF
HAS A REMAINDER OF ?4
HAS A REMAINDER OF ?6

n

LET ME .THINK A MOMENT.
YOUR NUMBER WAS 104

RIGHT ?YES

HOW ABOUT THAT! !

r

LET'S TRY ANOTHER.
PLEASE THINK .01' A NUMBER
YOUR NUMBER DIVIDED BI' 3
YOUR NUMBER DIVIDED BY 5
YOUR NUMBER DIVIDED B~' 7

BETWEEN 1 AND 100.
HAS A REMAINDER OF 71
HAS A REMAINDER OF 71
HAS A REMAINDER OF ?1

LET ME THINK A MOMENT.
YOUR NUMBER WAS 1 ,
I

RIGHT ?NO

FEAR I'OUR ARITHMETIC IS IN ERROR.

LET'S TRY ANOTHER.
PLEASE THINK OF A NUMBER
YOUR NUMBER DIVIDED BY 3
YOUR NUMBER DIVIDED B ... 5
YOUR NUMBER DIYIDED BY 7

BETWEEN :I. AND 100.
HAS A REMAINDER OF ?0
HAS A REMAINDER OF ?0
HAS A REMAINDER OF 71

LET ME THINK. A MOMENT.
YOUR NUMBER WAS 15 ,

RIGHT ? ... ES

HOW ABOUT THAT!!

159

S00!

90!"

NIM

CHINESE GAME OF NIM

Description
NIM is one of the oldest two-person games known to man: it is
believed to have originated in ancient China. The name, which
was coined by the first mathematician to analyze it, comes from
an archaic English verb which means to steal or to take away.
Objects are arranged in rows between the two opponents as in
the following example:

xxxxxxx
xxxxx
xxx
X

Row
Row
Row
Row

7
5
3
1

1
2
3
4

Objects
Objects
Objects
Object

Opponents take turns removing objects until there are none
left. The one who picks up the last object wins. The moves
are made according to the following two rules:
1.

2.

On any given turn only objects from one row may be
removed. There is no restriction on which row or on
how many objects you remove. Of course, you cannot
remove more than are in the row.
You cannot skip a move or remove zero obj"ects.

The winning strategy can be mathematically defined, however,
rather than presenting it here, we'd rather let you find it
on your own. HINT: Playa few games with the computer and
mark down on a piece of paper the number of objects in each
stack (in binary!) after each move. Do you see a pattern
emerging?
Source
One of the most popular computer games. Over 10 versions of
NIKwere submitted. One notable one came from Larry Ruane,
Mt. Prospect, Illinois, who programmed NIM for a DIGITAL
EduSystem 10. Quite a feat! The one published is from:
Robert G. Cox
Trinity College
Hartford, CT 06106

160

SAMPLE RUN

PROGRAM LISTING
.110 REM THIS PROGR~M USES A STRATEGY AS PRESENTED IN 'GAMES OF FUN AND
le5 REM STRATEGy', A PUBLICATION OF THE MATHEMATICAL SERVICES DEPART110 REM HENT OF COMPUTER CONTROL CO" INC,
1t5 PRINT 'THIS PROGRAM pLAYS NIH,'
120 PRINT '00 YOU ~ANT INSTRUC.uONS'I\INPUT QS
125 IF G,o'yES" THEN 135\IF Qlo'NO' THEN 190
130 PRINT "TYPE YES OR NO, .\INPUT QS\GOTO 125
135 PRINT
140 PRINT'
NIH XS PLAYED BY TWO PEOPLE PLAYING ALTERNATELY, 8EfORE'
145 PRINT "THE PLAY STARTS, AN ARBITRARY NUMBER OF STICKS OR OBJECTS IS'
150 PRINT 'PUT INTO AN ARBITRARY NUMBER OF PILES, IN ANY DISTRI8UTION'
155 PRINT '~HATEVER, THEN EACH PLAYER IN HIS TURN REMOVES AS MANY"
160 PRINT "ST!C~S .s HE WISHES FROM ANy PILE·.BUT FROM ONLy ONE PII.E,'
105 PRINT 'ANO AT LEAST ONE STICK, THE PLAyER wHO TAKES THE LAST STICK"
170 PRINT "IS THE ~INNER,'
175 PRINT'
THIS PROGRAM ALLOwS yOU TO SET uP THE INITIAL ARRANGEMENT"
180 PRINT 'OF pILES AND STICKs, IT wILL NOT ACCEpT MORE THAN TwENTY"
185 PRINT 'pILES OR STlCK5 IN EACH pILE,"
190 RANDOM
195 REH···············.·.CONFIGURATION INPUT.·.·······.················
200 PIM X(20,4), S (20), L(20), 52 (2~) ,N2 (4) ,C (20),53(20), V(20)
205 PRINT\PRINT 'HOW MANY PI~E5"\INPUT P\IP P.20 TMEN 215
210 IF P.INTCP) THEN 215\IF Pu0 THEN 215\GO TO 220
215 PRINT "ILLEGAL PILE NUMBER,'\PRINT\GO TO 206
220 PRINT\FOR 101 TO P
225 PRINT 'HOW MA.NY STICKS IN PILE'/I,\INPUT L(I"IF L(I)'20 THEN 235
230 IF L(I)'INT(L(I)) THEN 235\IF ~(I)<'0 THEN 235\GO TO 240
235 PRINT "ILLEGAL STICK NUMBER,'\PRINT\GO TO 225
240 NEXT I
.
245 FOR 101 TO p\S(!)'L(I)\G'G.LCll\NEXT I
250 PRINT\PRINT "00 YoU WANT TO GO FIRST"
255 INPUT OS\IF Qso'YES' THEN 34e\IF OSo'NO' THEN 390
200 PRINT 'TYPE YES OR NO."\GO TO 255
205 REM··CONTROL OF GAME RF-PEATS ANP TESTS FOR END OF GAME·············
270 IF G.0 THEN 275\IF F'I THEN 390\GO TO 320
275 IF FOI THEN 315
280 PRINT\PRINT "I WON, 00 yOu wANT TO PLAy AGAIN"
286 INPUT Q$\IF O$O'NO- THEN 290\IF QS"'vEs" THEN 300\GO TO 295
290 STOP
295 PRINT "TYPE YES OR NO, -\GO TO 285
300 PRINT\PRINT -SAME ARRANGEMENT",
305 INPUT O$\IF OSo"NO' THEN 205\IF QSo'YES' THEN 245
310 PRINT 'TYPE YES OR NO, -\GO TO 305
315 PRINT\PRINT "YOU oON, 00 YOU "ANT TO PLAY AGAIN" "GO T0 280
320 PRINT\PRINT "PILE NUMBER""STICKS LEFr.
325 FOR 1'1 TO P\IF S(I)'0 T~EN 33~\PRINT I,S(!)
330 NEXT I
335 REM·.··.····· •••• -·.····pLAYER' S MovE •••••••••••• _ ••••••••••• • •••••
340 PRINT\PRI;,T "WHIC~ pILE DO YOU WANT STICKS FRO_" I\lNpUT N
345 IF N'P T~EN 355\1F N'INHN) T~EN 355\IF "'00 THEN 350
350 IF SCN)'0 THEN 355\GO TO 35"
355 PRINT "ILLEGAL PILE NUMBER,"\PRINT\GO TO 340
360 PRINT\PRl"T "HO. MA~NY STICKS"I\INPUT T
365 IF T>S(N) THEN 370\IF T'INT(T) THEN 370\IF T<00 THEN 37.\GO TO 375
370 PRINT. 'IL~EGAL STICK NUMBE~,'t\PRINT\GO TO 350
375 SCN).S(N)_T\GoG.T
380 F'I\GO TO 270
385 REM •••• _ •••••••••••••• _MACHINE 'S MOVE ••••••••••••••••••••••••••••••
390 FOR 100 TO .\V(I)o0\NEXT I
3~5 FOR 1'1 TO P
40e
C(Il'SCI)
405
FOR E04 TO 0 STEP .1
410
IF SO).2.E THEN 415\S2(I).S2(1)+10.E\S(I)oS(I).2.,
415
NEXT E
420
FOR Y04 TO 0 STEP ·1
425
X(I, y) 0INTCS2(I) IU'Y"S2(!) 052(1 ).X CI, Y) *10 A Y
430
V(V)OV(Y)+XCI,Y)
435
NExT Y
440 NEXT I
445 R00
450 fOR Y'4 TO 0 STEP '1
455
IF VCYlI2-INTCV(Y)l2)00 THEN 480
46e
IF R'I THEN 470\0'INTCP*RND(X»+1
465
IF X(Q,V)<>I THEN 460\X(Q,y)a0\R'I\GO TO 4S0
470
IF X(Q,y)ol THEN 475\X(Q,Y)0I\GO TO .80
475
X(Q,Y)'0
480 NEXT Y
485 FOR 101 TO P
4~0
52(1)'0
495
FOR Y'4 TO 0 STEP '1
500
S3 (I ).X (I, Y).10AV\S2 (1)'52 (I) +93 (J I
505
NEXT Y
5IB
FOR E04 TO 0 STEP .1
515
IF g2(1).HICH PILE DO tOu WANT STICKS ,ROM? 2

HOW MANY STICKS?

1

I'LL TAKE 1 STICK
PILE NUMBER

,ROM PILE 3

•

STICKS LE,T

2
WHICH PILE DO YOU WANT STICKS ,ROM? 2
HOW MANY STICKS? 1

161

YOU WON.

DO YOU WANT TO PLAY AGAIN? NO

NUMBER

RANPOM NUMBER GAME

Description
In contrast to other number guessing games where you keep guessing until you get the random number se1eGted by the computer
(GUESS, TRAP, STARS, etc • .), in this game you get only one guess
per play and you gain or lose points depending upon how close
your guess is to the random number selected by the computer.
You occasionally get a jackpot which will double your point
count. You win when you get 500 points.
Program Author
Torn Adarnetx
Curtis Junior High School
Sudbury, MA 01776

1 PRINT •
NUMBER GAME'
2 PRINT\PRINT ·YOU NOW HAVE 100 POINTS'
1 PRINT 'BY GUESSING NUMBERS FROM 1 TO 5, YOU CAN GAIN OR LOSE"
4 PRINT 'POINTS DEPENDING UPON HOW CLOSE YOU GET TO A RANDOM'
5 PRINT 'NUMBER SELECTED BY THE COMPUTER"PRINT
6 PRINT 'YOU OCCASIONALLY WILL GET A JACKPOT WHICH WILL DOUBLE(!)"
7 PRINT "YOUR POINT COUNT.
YOU WIN WHEN YOU GET 500 POINTS. "
8 PRINT\P E 100
11 PRINT 'GUESS A NUMBER FROM 1 TO 5';
12 INPUT G
15 LET R"INT(5"RND(8»
16 LET S=INT(S"RND(8»
17 LET T~INT(S"RND(0»
18 LET U=INT(S"RND(8»
NIJMBER GAME
19 LET Y=INT(S"RND(8»
28 IF .G=R THEN 30
YOU NOW HAVE 199 POINTS
21 IF G=S THEN 40
BY GUESSING NUMBERS FROM 1 TO 5, YOU CAN GAIN OR LOSE
22 IF G=T THEN 58
POINTS DEPENDING UPON HOW CLOSE YOU GET TO A RANDOM
23 IF G=U THEN 68
NUMBER SELECTED BY THE COMPUTER
24 IF G-Y THEN 70
25 IF G)5 THEN 11
YOU OCCASIONALLY WILL GET A JACKPOT WHICH ~ILL DOUBLE(!)
38 LET P=P-5
YOUR POINT COUNT.
YOU WIN WHEN YOU GET 50e POINT"S.
3S GO TO 89
411 LET P=P+5
GUESS A NUMBER FROM 1 TO 513
45 GO TO 80
YOU HAVE 191 POINTS
50 LET P=P+P
GUESS A NUMBER FROM 1 TO 573
53 PRINT 'YOU HIT THE JACKPOT'
YOU HAVE 196 POINTS
55 GO TO 89
GUESS A NUMBER FROM 1 TO 513
69 LET P.P+1
YOU HAVE 101 POINTS
65 GO TO 89
GUESS A NUMBER FROM 1 TO 513
79 LET P=P-(P".5)
YOU HAVE 102 POINTS
80 IF P)599 THEN 99
GUESS A NUMBER FROM 1 TO 573
82 PRINT "YOU HAVE "; P; "POINTS'
YOU HAVE 97 POINTS
85 GO TO 11
GUESS A NUMBER FROM 1 TO 513
99 PRINT I.!!! !YOU WIN!!!! WITH -; p; ,.POINTS"
YOU HAVE 92 POINTS
99 END
GUESS A NUMBER FROM 1 TO 573
YOU HIT THE JACKPOT
READY
YOU HAYE 184 POINTS
GUESS A NUMBER FROM 1 TO 573
YOU HAYE 189 POINTS
GUESS A NUMBER FROM 1 TO 512.
YOU HAVE 184 POINTS
GUESS A NUMBER FROM 1 TO 5?2
YOU HIT THE JACKPOT
YOU HAVE 368 POINTS
GUESS A NUMBER FROM 1 TO 5?2
YOU HAVE 363 POINTS
GUESS A NUMBER FROM 1 TO 5?2
YOU HAVE 358 POINTS
GUESS A NUMBER FROM 1 TO 512
YOU HAYE 363 POINTS
GUESS A NUMBER FROM 1 TO 512
YOU HAVE 368 POINTS
GUESS A NUMBER FROM 1 TO 512
YOU IfAYE 363 POINTS
GUESS A NUMBER FROM 1 TO 5?2
YOU HAVE 358 POINTS
GUESS A NUMBER FROM 1 TO 512
YOU HIT THE JACKPOT
!!!!YOU WIN!!!! WITH 716 POINTS
READY

162

ICHECK

SOLITAIRE CHECKER GAME

Description
In this game or puzzle, 48 chec~ers are placed on the two
outside spaces of a standard 64-square checkerboard as shown:

•••• ••••
•••• ••••
••
••
••
••
••
••
••
••
••••••••
••••••••
The object is to remove as many checkers as possible by
diagonal jumps (as in standard checkers).
It is easy to remove 30 to 39 checkers, a challenge to
remove 40 to 44, and a substantial feat to remove 45 to 47.
Program Author
David Ahl
Digital Equipment Corp.
Maynard, MA 01754

163

SAMPLE RUN

PROGRAM LISTING
1CHECK

i:5 PRINT

05:54 PH

~~:~~

SOLITAIRE CHECKER PUZZLE BY DAYID AHL
25-JUN-73

48 CHECKERS ARE PLACED ON THE 2 OUTSIDE SPACES OF A
STANDARD 64-S~UARE CHECKERBOARD.
THE OBJECT IS TO
REMOVE AS MANY CHECKERS AS POSSIBLE BY DIAGONAL JUMPS
8 THEN 230
190 IF T2)8 THEN 230
21)0 IF ABSB THE 20
210 IF' X
293 GOTO 500
31210' IF- X>C THEN 2!21
31121 IF X
377 E=INT(E/3)
378 F=INT(F/3)
379 GOT50~
380 PRI "YOU WIPED OUT ONE OF MY ARMY PATROLS# BUT In
381 PRI "DESTROYED 2 NAVY BASES# AND BOMBED 3 ARMY BASES."
385 A=INT(A/4)
387 B=INT(B/3)
3913 D=INT(2*D/3>
5013 PRI
5!211 PRl~ "YOU"~ "ME"
51121 PRI .. ARMY .... A~ D
5213 PHI "NAVY" # B .. E
53121 PRI'·A.F." .. C~F
11300 PRI "WHAT I S YOUR NEXT MOVE?"

1121113 PRI "ARMY:: 1
132~

MEN FROM YOUR ARMY.

NAVY=2

I AM AT WAR WITH YOU.
WE HAVE 72000 S01..DIERS A PIECE.
DISTRIBUTE YOUR FORCES.
ME
YOU
ARMY
30300
? 720130'
NAVY
23000
? 3130121130
A.F.
2200~
? 34
DISTRIBUTE YOUR FORCES.
ME
YOU
ARMY
30030
2333
NA1JY
20"0130
? 54322
A.F.
22~00
? 74633
DISTRIBUTE YOUR FORCES.
ME
YOU
ARMY
31330'121
? 3455
NAVY
23003
? 6344
A. F.
2200"0
? 2771210
YO:; ATTACK FIRST. TYPE 1 FOR ARMY
2 FOR NAVY
AND 3 FOR. AIR FORCE.
? 2
HOW MANY MEN
? J 7899
HorN MANY MEN
? 30e10
YOUR ATTACK

WAS

STOPPED!

YOU
A..QMY

3455

ME
30000

NAVY

3344

2000~

A.F.
27700
22030
WHAT IS YOUR NEXT MOVE?
ARMY=!
NAVY=2
AIR F'ORCE=3
? 2
HOW MANY MEN
? 3344
I SU!lJK 2 OF YOUR BATTLESHIPS .. AND MY AIR FORCE
WIPED OUT YOUR UNGUARDED CAPITOL.
FROM THE RESULTS OF' BOTH OF YOUR ATTACKS ..
YOU LOST-I CONQUERED YOUR COUNTRY. IT SERVES YOU
RIG~T FO~ PLAYING THIS STUPID GAME!!!

AIR FORCE=3"

INPUT G
"HOW t1ANY MEN"

112130 PH'1

READY

11214121 INPUT T
IF T<0 THE 11213121
ON G GOTO 160121 .. 1 7!210 .. 181/J0
IF T>A THE 112130
IF T<,D/2 THE 163121
PRI"YQU DESTROYED MY ARMY!"
16160=0
1617 GOTO 2000
163121 PRI "1 WIPED OUT YOUR ATTACK"

RUN
I AM AT WAR WITH YOU ..
WE HAVE 72000 SOLDIERS A PIECE.
DISTRIBUTE YOUR FORCES.
ME
YOU
ARMY
30000
? 201210
NAVY
2001210
? 300210

1635 A=A-T

YOU ATTACK FIRST. TYPE I
AND 3 FOR AIR FORCE.

1045
11215!21
16121121
161121
1615

1640 GO TO 2~00
173121 IF T>8 THEN 11213121
171121 IF TC THEN 103~
1810 IF T>F/2 THEN 183~
I 82~ GOT 1850
1830 PRI "MY NAVY AND AIR FORCE IN A COMBINED ATTACK LEFT"
1831 PHI "YOUR COUNTRY IN SHAMB1..ES."
1835 A=Al3
[837 B=B/3
1840 C=C/3
[845 GOTO 200~
1850 PRI "ONE OF YOUR PLANES CRASHED INTO MY HOUSE. I AM DEAD."
1851 PRI"MY COUNTRY FELL APART."
1860 GOTO 2~1~
2~00 PRI
20~1 PRI "FROM THE RESULTS OF BOTH OF YOUR ATTACKS,"
2002 IF A+B+C>3/2*CO+E+F) THE 21211121
212105 IF A+B+C<2/3*CO+E+F) THE 212115
20e6 PRI"THE TREATY OF PARIS CONCLUDED THAT WE TAKE OUR"
212"'7 PRI "'RESPECTIVE COUNTRI ES.. AND LIVE IN PEACE. Of
2008 GOT2020
2Q;I1.0 PRI "YOU VON, OH f SHUCKS!!! f!"
2~12 GOTO 2020
201.5 PRI "YOU LOST-I CONQUERED YOUR COUNTRY. IT SERVES YOU"
2016 PRI "RIGHT FOR PLAYING THIS STUPID GAME!! I"
2020 END

A. F.

22121121121

?

6444

FOR ARMY

2 FOR NAVY

? 3
HOW MANY MEN
? 6443
YOU WIPED OUT ONE OF MY ARMY PATROLS ..

DESTROYED 2 NAVY BASES ..

BUT I
AND BOMBED 3 ARMY BASES.

YOU
ME
ARMY
500
2~000
NAVY
10021121
2000'0
A.F.
6444
22!Z1e!!ZI
WHAT IS YOUR NEXT MOVE?
ARMY=J NAVY=2 AIR FORCE=3
? 3
HOW MANY MEN

? 5
ONE OF YOUR P1..ANES CRASHED INTO MY HOUSE.

MY COUNTRY FELL APART.
YOU WON .. OH! SHUCKS!!!!!
READY

233

I AM DEAD.

II. ·
"
4

~

"

WEKDAY

FACTS ABOUT YOUR BIRTHDAY

Description
This program gives facts about your date of birth (or some
other day of interest). It is not prepared to give information on people born before the use of the current type of
calendar, i.e. year 1582.
You merely enter tod,ay's date in the form - month, day,
year and your date of birth in the same form. The computer
then tells you the day of the week of your birth date, your
age, and ho~ much time you have spent sleeping, eating,
working, and relaxing.
Source
WEKDAY was adapted from the GE timesharing program by:
Tom Kloos
Oregon Museum of Science and 'Industry
Portland, Oregon 97200

234

\,

PROGRAM LISTING
10 PRINT"
120PRINT
12. LET YI • 1970
130 PRINT" ENTER TOOAY'5 DATE IN T~IS FORM. MONTH. DAY, YEAR"'
1.0 INPUT Ml,Dl.Yl
150 IF Yl>100 THEN 170
160 LET YI - Yl + 1900
170 DEF FNACA).INTCA/4)
180 DIM TCl2)
190 OEF FNBCA)'INTCA/71
210 FOR I- I TO 12
220 READ T( 11
230 NEXT I
240 PRINT
2.IPRINT"THIS PROGRAM DEMONSTRATES PDP-II ~A5IC AND ALSO GIVES"
242PRINT'FACTS ABOUT A DATE OF INTEREST TO YOU·
244 PRINT
2.5 PRINT"ENTER DATE OF BIRTH IN THIS FORMI MO,OAy,yEAR",
250 INPUT .,O,Y
260 PRINT
270 IF Y - 75 >0 THEN 280
275 LET Y • Y+1900
280 LET II • INTCCY-15~0)/l00)
290 IF Y-1582<0 THEN 1300
3B0 LE,T A • 11+5+CII+3)/'
310LET 12 - INT(A-FNBCA1*71
320 LET Y2" INT(Y/1001
330 LET Y3 • INTCY-Y2*1001
340 LET A - Y3/4+Y3+0+TCM)+12
350 LET B - INTCA_FNBCA)*7)+1
360 IF .>2 THEN 470
370
IF y3- 0 THEN 4.0
380 LET TI - INTey-F,ACy)+4)
390 IF TI<> 0 THEN 470
400 IF B<>~ THEN 420
410 LET 6 - 5
420 LET B • S-I
430 GOTO 470
440 i.ET A _ II-I
450 LET TI • INTCA-FNACA1*4)
460 IF TI " • THEN 400
470 IF B <> 0 THEN 490
480 LET 6 • 7
490 If (Yl*12+MIl*31+DII T~EN 590
580 PRINT "SUNDAY"
590 IF 6<>2 THEN 610

1270
1280
1290
13B0
1305
1310
1330
1370
1380
1390
1400
14U
14 20
1430
14.0
1450
1460
1.70
1480
1490
1500
1510
1520
1530
15.0
1550
1560
1570
1580

ENTEFi: TODAy'''' S DATE IN TH I:; FORM:

'I
1

I
I

MONTH. DAY,

YEAR? 646, 12, 73

THIS PROGRAM DEMONSTRATES PDP-11 BASIC AND ALSO GIVES
FACTS ...·C

RUN
WEKDA~

It.

02:16 PM

12-JUN-?3

ENTER TODA>"S DATE IN THIS FORM: MONTH, DA~,

~EAR?

6,12,73

THIS PROGRAM DEMONSTRATES PDP-l1 BASIC AND ALSO GIVES
FACTS ABOUT A DATE OF INTEREST TO YOU

610 IF 6<>3 THEN630
620 PRINT "TUESDAY"
5J~ IF So, THEN 650
650
560
670
580
590
700
710
720
730
740
750
760
770
780
790
800
810
820
830
835

DATA e, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5
LET KI' INTCF+A8)
LET 15 • INTCKI/365)
LET KI 0 Kl-05-355)
i.ET 16 0 INTCKI/J0)
LET 17 • KI-(I5+30)
LET K5 • K5-IS
i.ET K6 - K6-I6
LET K7 • K7-17
I f K7 >. 0 THEN 1480
LET K7 • K7+30
LET K6 • K6-1
If K6 > 0 THEN 1510
LET K6 " K6+12
LET K5 • KS-l
PRINT IS.I6,17
RETURN
If K6 • 12 THEN'I550
GOTO 1090
~ET K5 • K5+1
LET K6 0 0
GOTO 1090
END

SAMPLE RUN

600 PAINT "MONDAVP

640 PRINT

GO TO 710
PRINT 'FRIDAY THE THIRTEENH--~8EWARE I"
GOTO 710
PRINT "NOT PREPARED TO GIVE DAY OF WEEK PRIOR TO MDLXPXl! _N
~~~~\;40 THE CURRENT CALENDAR 010 NOT EXIST BEFORE THAT YE4R,"

ENTER DATE OF BIRTH IN THIS FORM: MO, DAY, >'EAR? 5,17, ::9

5 I

q~EDNESOAytl

IF 605 THEN 670
PRINT "THURSOAV"
IF 6<>6 THEN 690
GOTO 1250
IF 607 THEN 710
PRINT "SATURDAV'
IF CYI*12+Ml)*31+Dl°CY+12+M)+31+0 THEN 1120
~ET IS.Y1-Y
PRINT
LET 16-MI-M
LET 17001-0
IF 17>'0 THEN 790
LET IS-18-1
LET 17'17+30
IF 16>'0 THEN 820
i.ET 15'15-1
LET 15018+12
IF 15<0 THEN 1310
IF 17<>0 THEN 850
If 16<>0 THEN 650

17 I

1939

WAS A WEDNESDA>'
YEARS

YOUR AGE
't'OU HAYE SLEPT

'1'01.1 HAYE EATEN
','01) HAVE WORKED/STUD I ED
YOU HAYE RELAXED

MONTHS

[lAYS
25

34

e

11
5
7

11

10

18
5

B

5

25

9

**YOU MAY RETIRE IN 2004 **

CALCULATED B>' THE BEST MINICOMPUTER TO[oA>' -

THE POP-11

THIS PROGRAM DEMONSTRATES PDP-l1 BASIC AND ALSO GIVES
FAGTS ABOUT A DATE OF I NTEREST TO YOU
ENTE~'

DATE OF BIRTH IN THIS FORM: MO,

9 / 24 I 1948

840 PRINT t'****HAPPy BIRTIoIDAy ...... II
850 PRINT II ",~ ","VEAAS","MONTHS","DAYS"
860 PRINT 'YOUR AGE
",15,16,17
870 LET AS' (15+365)+(16+30)+17+INT(l5/2)
880 LET KS'15
890 LET K6'I6
900 LET K7. I7
920 LET E"Yo55
940 LET Fo. 35
950 PRINT "YOU HAVE SLEPT ",
960 GOSUB 1370
970 LET Fo,I7
980 PRINT "YOU HAVE EATEN ",
990 GOSUB 1370
1000 LET Fc,23
1010 IF K5 > 3 THEN U40
1020 PRINT"VOU ~AVE P~AYEO ".
1030 GOTO 1080
1040 IF K5 > 9 THEN 1070
1050 PRINT 'YOU HAVE PLAYED/STUDIED",
1060 GO TO 1080
1070 PRINT "vOU HAVE wORKED/STUDIED",
1080 GOgU6 1370
1090 PRINT "YOU HAVE RELAXED ',K5,K8,K7
1100 PRINTl1Ul PRINT
..,OU MAY RETIRE IN"JE,II •• "
1120 PRINT
1130 PRINT" CALCULATED 6Y THE BEST MINICOMPUTER TODAY. THE POP-II'
1140 FOR Q'1 TO 2
1150 PRINT
1160 NEXT Q
1170 PRINT
1240 GOTO 240
1250 If 0-13 TMtN 12S0
1260 PRINT '~AIoAy ,

>'OUR AGE
YOU HAYE
"'OU HAVE
YOU HAVE
"'(1) HAVE

II ",'I ••

235

om', >'EAR? 9,24,48

WAS A FRIDA¥
I'ERRS
24

SLEPT
EATEN
WORKED/STUD I ED
RELAXED

B

4
5
6

110tITHS
8
7
2
8

1

**YOU MAY RETIRE IN 2013: **

CALCULATED BI' THE BEST MINICOMPUTER TODA¥ -

THE PI>P-l1

DAYS

18
27
13
10
28

,.
I"

WORD

WORD GUESSING GAME
I

Description

I

I,

WORD is similar to Hangman in that the player must guess
a word with clues as to lette~ position furnished by the
computer. However, instead of guessing one letter at a time,
in WORD, you guess an entire word (or group of 5 letters,
such as ABCDE). The computer will tell you if any letters
in your word are in the mystery word and if any of them are
in the correct position. Armed with these clues, you go on
guessing until you get the word or, if you can't get it,
input a "?" and the computer will tell you the mystery word.
You may change the words in Data Statements 512 and 513, but
they must be 5-1etter words.
Program Author
Charles Reid
Lexington High School
Lexington, MA. 02173

236

SAMPLE RUN

PROGRAM LISTING
2 PRINT:PRINT:PRINT:PRINT "PROGRAM 'WORD'"
LEXHIOTON HS,

:l REM *** WRITTEN BY CHRIS REl[>,
5 DIM S(7),A(7),·l(7),D(7),P(7)

PROGRAM " WORD"
CLASS OF '73

10 PRINT:PRINT "I AM THINKING OF A ~IORD -- YOU GUESS IT.
I WILL GIVE VOU"
15 PRINT "CLUES TO HELP YOU GET IT.
GOOl> LUCK' ''':PRINT:PRINT
20 RANC(T GUESS

GUESS A FIVE-LETTER WORD? CFGHI
THERE ~~ERE :1 MATCHES AND THE COMMON LETTERS WERE.
FROM THE EXACT LETTER MATCHES, YOU KNOW.

IF YOU GI . . . E UP.

:1.44 P(J)=13

C

TYPE "?" FOR YOUR

NE>~T

C

c----

GUESS

146 NEXT J
GUESS A FIVE-LETTER WORD? C,TKWN

:150 PRINT "GUESS A FIVE-LETTER fiORI''';
160 INPUT L.

YOU MUST GUESS A 5-LETTER WORD.

170 G=G+1

START AGAIN

172 IF L'=S. THEN 500

1813 CHANGE L$ TO L
19121 IF L(1)=63 THEN 3013
2tH3 IF LCO)<>5 THEN 4ee

GUESS A FIVE-LETTER WORD? C~lKLM
THERE WERE 3 MATCHES AND THE COM~ION LETTERS HERE ..
FROM THE EXACT LETTER MATCHES, VOU KNOfl..

c----

GUESS A FIVE-LETTER WORD? COLNN
THERE WERE J MATCHES ANI> THE CO~IMON LETTERS fIERE.
FROM THE EXACT LETTER MATCHES, YOU K~IO~I.

C--M-

CL~I

205 M=0:Q=:1.
2:10 FOR 1=:1 TO 5
22~3 FOR J=:1. TO 5

230 IF SO )()LeJ) THEN 260
23:1 P(Q)=L(J)
232 (;!=8+:1.

GUESS A FIVE-LETTER WORD? COLMP
THERE WERE 4 MATCHES AND THE COMMON LETTERS WERE.
FROM THE EXRCT LETTER MATCHES, YOU nlml ..

211 IF I()J THEN 250
2413 A('J)=L(·J)
250 M=M+:1.
260 NE>n ,J

GUESS A FIVE-LETTER WORD?
'-r'Ol! HAVE GUESSED THE WORD.

265 NEXT I
270 A(l.3)=5
272 pce )=M
275 CHANGE A TO A.
277 CHANGE P TO PI
280 PRINT "THERE ~IERE"M"MATCHES ANI' THE COMMON LETTERS WERE ... ",
285 PRINT "FROM THE EXACT LETTER MATCHES, YOU KNOW..
. ", AI
286 IF A'=5$ THEN 5QQ
TYPE '?'

CL~IP
C--~IP

CLU~lP

I T TOOK 6 GUESSES!

WANT TO PLAY AGAIN? YES

p.

287 IF M)l THEN 289
288 PRINT:PRINT "IF YOU GIVE UP,
289 PRINT

CL~I

Y'OU ARE STARTING A NEW GAME ..
GUESS A FIVE-LETTER WORI'? ABCDE
THERE ~~ERE 0 MATCHES AND THE COMMON l.ETTERS fIERE.
FROM THE EXACT LETTER MATCHES, VOU KNOW.

FOR YOUR NEXT GUESS"
IF YOU GIVE UP,

TYPE '7'

FOR YOUR NENT GUESS

29121 GOTO 153
3:03 CHANGE S TO 5$
3:11 PRINT "THE SECRET WORD IS "S$:PRINT

320 GOTO ]0
400 PR I NT: PR!NT "YOU MUST GUESS A 5-LETTER fIORD.

410
5')0
510
520
·530

GUESS A FIVE-LETTER WORD? FGHI,T
THEI':E WERE 2 MATCHES AND THE COMMON LETTERS WERE.
FROM THE EXACT LETTER MATCHES, YOU KNOW.

F----

GUESS A FIVE-LETTER WORD? FIKLM
THERE WERE 2 MATCHES AND THE comlON LETTERS flERE
FROM THE EXACT LETTER MATCHES. YOU KNml

FI
FI---

GUESS A FIVE-LETTER WORD? FHIOP
THERE WERE 2 MATCHES AND THE COMMON LETTERS WERE.
FROM THE EXACT LETTER MATCHES, YOU KNOW.

FI
FI---

FI

START AGA IN"

PRINT:G=G-i:GOTO 158
IT TOOK"G"GUESSES!" :PRINT
INPUT "WANT TO PLAY AGAIN";Q$
IF Q$="YES" THEN ]0
DATA 12, ",'INKV", "SMOKE", "WATER", "GRASS", "TRAIN", "~IlGHT", "FIRST"

PRINT "YOU HAVE GUESSED THE HaRD.

548 DATA "CANDY", "CHAMP", "WOULD", "CLUMP", "DOPEY"
999 END

GUESS A FIVE-LETTER WORD? FIRST
YOU HAVE GUESSED THE WORD.
IT TOOK 5 GUESSES'

READY

WANT TO PLAY AGAIN? NO
READY

237

YAHTZE

DICE GAME OF YAHTZEE
!

Description

i
I

yahtzee may be played by up to 15 people. The object of the
game is to get the highest grand total score. Each player
on his turn receives from the computer the values of 5
pseudo dice. He may then roll as many of them as he wants
to again. This may be repeated once again (3 rolls maximum) .
To roll again, you tell the computer how many dice you want
to re-roll or change and the number of each die. You play
13 rounds for a complete game.
After you have finished rolling, you must decide how you
want to score the five dice. Typing "SUMMARY" will show
you which categories have been used, otherwise, you must
decide on one of 13 categories or "ZERO" to eliminate a
category with no score.
category

How Scored

ACES
TWOS
THREES
FOURS
FIVES
SIXES
THREE OF A KIND
FOUR OF A KIND
FULL HOUSE
SMALL STRAIGHT
LARGE STRAIGHT
YAHTZEE
CHANCE
ZERO·

Count and add all ones.
Count and add all twos.
Count and add all threes.
Count and add all fours.
Count and add all fives.
Count and add all sixes.
Total all 5 dice (assuming 3 of a kind) •
Total all 5 dice (assuming 4 of a kind) •
25 Points (3 of one kind, 2 of another) .
30 Points (Sequence of 4) .
40 Points (Sequence of 5) .
50 Points (5 of a kind) .
Total of all 5 dice.
Zero out any category above.

If your accumulated score of the first six categories ever reaches
63 points, you receive a bonus of 35 points.
Source
Unfortunately, the program author of this extremely comprehensive
game is unknown.

238

PROGRAM LISTING
180111 A(0)-!
1010 FOR U-l TO !
1020 A(U).7
1138 NEXT U
1040 CHA~GE A TO ca
U60DIMAll!, 15) ,TI 15, 15),r I 15, 15) ,5115, 15) ,~I IS, 15) ,KI15, I!) ,HI1!, 15)
1070 FOR I-I TO 5
188111 B.IX ).0
189111 Q(X).III
1180 AII)alll
111111 ~EXT I
1120 RANDOM
1130 PRINT "HOW MANY PLAYERS Inn. '0' FOP INSTRUCTIONS] '"
1140 INPUT P
115111 IF P>15 TKEN 1180
1160 IF P-0 THEN 4980
1170 GO TO 1200
1180 GOSUB 5710
1190 GO TO 113111
120111 XF P.,01 TKEN 1220
121111 GO TO 1240
1220 GOSUS 5730
12]0 GO TO 1140
1248 rOR I-I TO P
1250 Ael,I)=-!
1260 TII,lI-.5
1270 T(2,Il.-!
1280 F(1,I).-;
1290 F(2,I) •• 5
13AIII 5(1,1).-5
131111 T(3,I)"5
132111 FI3,1).·5
1330 FI4,I) . . 5
1340 512,0 0 -5
13SI11 L(1,l).-S
1360 HIla.S
1370 CO) •• 5
1380 K(1,I)=1II
139111 KII).0
1400 MII)=0
1410 PRINT "NAMg",
1428 INPUT Nt (I)
1430 IF N$II)-'WHATI' THEN 1450
1440 GO TO 1470
I4S8 GOSUB 55U
1460 GO 10 1410
1470 NEXT I
1480 R=0
149111 R"R+l
1495 IF R>13 THEN 8470
1500 PRINT
ISH1 PRI~T
1520 PRINT "ROUHO',R
15]0 PRINT
1!40 fOR 1"1 TO P
155111 P!lINT
1560 PRINT
1570 PRINT NSCIl,"'S TURN"
1580 FOR Lal TO 5
1590 AIL)~INT(b*RNOI-I'+I)
1600 NEXT L --1605 GOBUB 1610
1607 GO TO 1700
1610 Go"
1620 FOR Xol TO ~
1630 IF AIXl>DAIX+Il THEN 168~
1640 H.AIX)
1650 AIX)"A(X+l)
1660 AIX+IlOK
167111 Gal
1680 NEXT X
1685 IF Gal THEN 1610
169111 RETURN
1700 PRINT 'YOU HAVE A .,All),A(2l1AI3),A(4),A(51
171111 PRINT "THIS IS YOUR 2ND or 3 ROLLS,"
1720 PRINT "HOW MANY DO YOU WANT TO C~ANG~",
1730 INPUT Z
1740 IF Z-,01 THEN 1760
1750 GO TO 1710
1760 GOSUB 5600
1770 GO TO 1730
1780 IF Z"0 THEN 2620
1790 IF Z-5 THEN 1890
181110 fOR 5_1 TO Z
1810 PRINT "WHICH"
1820 INPUT 81S)
1830 IF B(8)=,01 TKEN 1850
1840 GO TO 1870
1850 GOSUB ~620
1860 GO TO 1810
1870 NEXT 8
1880 GO TO 1930
1890 FOR S_I TO 5
1900 Ala).INTI6*RNOI-I)+I)
1910 NEXT S
1920 GO TO 2050
1930 FOR Lal TO S
1940 rOR LI.I TO 5
195111 IF BIL)aLI THEN 1970
1960 GO TO 1980
1970 AILIl.QI~1l
1980 NEXT Ll
1990 NEXT L
211100 FOR S=I TO 5
2010 IF AIS).0 THEN 2030
2020 GO TO 211140
2030 AIsl=INTI5*RNOt-l)+I)
2040 NEXT S
2050 GOSUI U18
2140 PRINT 'YOU HAVE AH,A(I),AI2),AI3),A(4),A(!l
2150 PRINT 'THIS 18 YOUR LAST ROH,"
2160 PRINT 'HOW MANY 00 YOU WANT TO CHANGE",
2170 INPUT Z
218111 IF Z=,01 THEN ~2~0
2190 GO TO 2Ue
2281 GO.UI uee
221111 GO TO 2178
2220 IF Z.0 THEN 2621

m: :~RZ~:IT;~N!mlll

239

22!IIJ
2268
2270
2280
2290
2300
2118
212111
2HIII
2140
2350
2360
237e
238111
2390
241110
2410
2420
2430
2440
2450
2460
2470
2480
2490
2500
251111
2520
2610
2620
2610
2640
2650
2660
2670
2675
2680
2690
271110
2710
2720
2730
2740
2750
2760
2770
2180
2790
2800
2810
2820
2830
2840
2850
2860
2870
2880
2890
2900
29te

B(E) ••
NEXT E
FOR •• 1 TO Z
PRINT "WHICH',
INPUT BIS)
IF B(8).,01 THEN 2320
GO TO 2348
GOSUB 5620
GO TO 2280
NEXT a
GO TO 2400
FOR Sal TO 5
A(Sl_INT(6¥RNO(_I)+I)
NEXT S
GO TO 2520
FOR ~=1 TO 5
FOR ~t.1 TO 5
IF B(L).LI THEN 2440
GCJ TO 2450
AILIl.Q(L)
NEXT Ll
NEXT L
FOR S.I TO 5
IF A(S).0 THEN 2500
GO TO 2510
Ala).INTI6.RNOI-I).I)
NEXT S
GOSUa 1610
PRINT "10U HAVE A ",ACllIA(2),A(3),AI4),AI5)
PRINT "HOW DO YOU ,;ANT THIS ROUND SCORED",
INPUT ZI
IF U."IIHAT1" THEN 2680
IF UUSUMMARY' THEN 2610
GO TO 2700
GOSUS 6140
GO TO 2620
GOaU8 5650
GO TO 2630
IF U."ACE!" THEN 2850
IF ZS-"TWOS" THEil 2940
IF Ze."THREES" THEN 3030
IF Z$-"FOURS' THEN 3120
IF U.'FIVES" TH!!:N la10
IF "."SIXIIS" THEN HIII0
IF U-"TKREE or A KINO" TH!!:H 3390
IF za""FOUR OF A KIND" THEN 3440
IF za-"FULL HOUSE" THEN ]52111
IF U-"SM, STRAIGHT" THEN ]620
IF U.'LG, STRAIGHT" THEN l66~
IF "_"YAHTZEE' ·THEN 3730
IF U="CHANCE' THEN )820
IF ZS_"ZERO" THEN 3890
GO TO 2620
IF A(I,I)<>-5 THEN 3870
All,Xl-e
FOR S.1 TO !
IF AIS)-I THEN 291110
GO TO 2910
All,I)aAl1,Il+1
NEXT 8

2930
2940
2950
2960
2970
2980
2990
3000
3010
3020
3030
31140
311150
3060
311170
3080
3090
3100
3110
312111
3130
3140
3150
]160
3170
3180
]185
J190
3210
3220
323111
3240
3250
]260
3270
1280
]29111
]300
)J10
3]20
3330
U40
335111
U60
)370
3380
U90
1400
]410
]420
]U0
]440
3450
3460
3478
3480·
]490
3500
3510

GO TO 4690
If' '1'11,1)<>-5 THEN 3870

292i-MCi i-A I I, I)
T(1,I).~

FOR S_I TO 5
IF A(S)=2 THEN 2990
GO TO 3000
Tll,I).T(I,I).Z
NEXT S
MO)-TtI,I)
GO TO 4690
IF 112,1)0-5 THEN 3870
TI2,I).0
FOR S_I TO 5
IF AIS)-] THEN 3080
GO TO 3090
TI2,I)-T(2,I).J
NEXT S
MII).TI2,I)
GO TO 4690
If' Fll,IlC>-! THEN 38.70
FII,I)00
FOR S=I TO 5
I!' AIS).4 THEN 3170
GO TO lIee
I'll,I)=F(I,I)+4
NEXT 8
MII)afll,I)
GO TO 4690
IF F(2,I)<>-! THEN ]870
FI2,I)."
FOR S-1 TO 5
XF AI5l=S THEN 3260
GO TO 3270
F(2,I)=F(2,I)+5
NEXT S
M(1).F(2,I)
GO TO 4690
IF SII,I)<>-! THEN 3870
SI1,Il=0
FOR S-1 TO 5
IF AtS).6 THEN 3JS0
GO TO 3360
8(1,0-811,1)+6
NEXT 8
MII).Stl,I)
GO TO 4690
IF TI3,I)<>-S THEN ]810
T(3,I)D0
TIl, I) -A I 1) +A(2l +A I ]l+A( 4) +A 15)
M(Il_T(3,I)
GO TO 4690
IF FI3,I)<>-S THEN 3870
IF All)<>AI4) THEN 4960
IF A(2)OAIJ) THEN 4960
F(3,Il.0
FI], I)-A (1) +A I 2HAI 3)+A( 4)+A (5)
MIl).rll,I)
FI31l)=0
GO TO 469111

3520 IF F(4,I)<>.5 THEN 3870
)530 IF A(I)<>A(2) THEN 4960
3540 IF A(4)OA(5) THEN 4960
3550 IF AO)<>A(2) THEN 3570
3560 GO TO 3590
3570 IF A(3)<>A(4) THEN 4960
3580 GO TO 3590
3590 '(4,1)-25
3600 M(I).F(4,I)
3610 GO TO 4690
3620 IF 5(2,1)0-5 THEN 3870
3630 SC2,I).30
3640 M(Il-5 (2, I)
3650 GO TO 46U
3660 IF LCI,I).>-5 THEN 3870
3670 IF A(1)OAC5)+4 THEN 4960
3680 IF A(2)<>AC4)+2 THEN 496~
3690 IF A(3)<>AC5)+2 TH~N 4960
3700 ~(.I,I).40
3710 MCI)oLCI,I)
3720 GO TO 4&90
3730 IF YCI)<'-S THEN 3870
3740 FOR ODI TO 5
3750 FOR 01"1 TO ~
3760 U A(0)OAC01) THEN 4960
3770 NEXT 01
3780 NEXT 0
3790 Y(1)=50
3800 MCI)'YCI)
3810 GO TO 4690
3820 IF CCI).>-5 THEN 3870
3830 C (I) _A C1) +A C2) +A (3) +A C4,.A C5)
3840
3850 MCI)'C ell
3860 GO TQ 4690
3870 GOSue 4650
3880 GO TO 2620
3890 PRINT "WHAT DO YOU WANT TO ZERO",
3900 INPUT ZS
3920 IF' ZS."SUMMARy tI THEN 3940
3930 GO TO 3970
3940 Gosue 6140
3945 GO TO 2620
3950 Gosue 5680
3960 GO TO 3900
3970 IF ZSe'ACES" THE. 4110
3980 IF Z$="TtoJOS tl THEN 4100
3990 IF Z$>"THR~ES" THEN 4190
4000 IF ZS."FOURS" THEN 4230
4010 IF ZS."FIVES" THEN 4270
4020 IF Z$="SIXES" TH~N 4310
4030 IF ZS;;:"THREF. Of A KINDH THEN 4350
4040 Ir Z$=IIFUUH OF A KINQu Trie:N 4390
4050 IF' ZS;;"FULL HOUSE" THEN 44J0
4060 IF ZS-"SM, STRAIGHT" THEN 4470
4070 IF ZSo"LG, STRAIGHT" THEN 4510
4080 IF ZSa"YAHTZEE" THEN 4550
4090 I~ ZSa Il CHANCE, 1 THEN 459~
4100 GO TO 3890
4110 IF A(1,I)O-, THI-5 THEN 4630
4160 T(1,z)00
4170 MO)-T(1,I)
4180 GO TO 4H0
4190 IF TC2,I)<'-5 THEN 4630
4200 T(2,0=.
4210 MCIJ aT e2,r)
4220 GO TO 4690
4230 IF F(1.I)<>-5 THEN 4&30
4240 F(1,x).0
4250 MCIl.F C1, I)
4260 GO TO 4690
4270 IF F(2,I)"-5 TH~N 4&30
4280 F(2,x).~
4290 MCI )arc 2. I)
4300 GO TO 4690
4310 II' S(1,I)0-5 THEN 4630
4320 5(1,1)=0
4330 MC!laS (1, I)
4340 GO TO 4690
4350 IF T(3,1)<>05 IHEN 4030
4360 TO,x)'0
4370 HCI)·TO,I)
4380 GO TO 4690
4390 IF FC3,I)"-, THEN 4630
4400 fO,I».
4410 M(I ) ' f (J,x)
4420 GO TO 4690
4430 IF Fe4,I)<>-5 THEN 4630
4440 F(4.I)=0
4450 MCI).Fe4,x)
4460 GO TO 4690
4470 IF SC2,Il<>-5 THEN 4&30
4480 S(2,I)'0
4490 M(1)=Se2.I)
4500 GO TO 4690
4510 IF ~Cl,I)<>-5 THEN 4630
4520 LO,I)=0
4530 MCI )=LCl, Xl
4540 GO TO 4690
4550 IF YCI )<>05 THEN 4630
4560 YCI) ••
4570 MO)·YCI)
4580 GO TO 4690
4590 IF CCI)<>-5 THEN 4630
4600 C (1»0
4610 HCI)"CCI)
4620 GO TO 4690
4630 GOBUe 4650
4640 GOTO 2&20
4650 PRINT "YOU HAVE ALRgADY USED
AS A CATEGORY",CS
4660 PRINT
4670 RETURN
4680 GOTO 2620
4690 PRINT NSCI)," YOU GET A SCURE OF ",MCIlJ" FOR THIS ROUND"
4700 GO TO 5750
471_0 NEXT I

",ZS,"

240

4720
4730
4740
4750
4760
4770
4780
4790
4800
4810
4820
4830
4840
4850
4860
4870
4880
4890
4900
4910
4920
4930
4940
4950
4960
4970
4980
4990
5000
5010
5020
5030
5040
5050
5060
5070
5080
5090
5100
5110
5120
5130
5140
5150
5160
5170
5180
5190
5200
5210
5 220
5230
5240
5250
5260
5270
5280
5290
5300
5310
5320
5330
5340
5350
5360
5370
5380
5390
5400

PRINT
FOR 0101 TO P
IF MCJ).A(I,J) THEN 4810
IF MeJ)OT(l,J) THEN 4810
IF MCJ)-T(2,J) THEN 4810
IF M(J).FC1,J) THEN 4810
IF MCJ).F(2,J) TM!:N 4810
IF M(J)-SC1,J) THEN 4810
GO TO 4920
KC1,J).KC1,J)+MeJ)
GO TO 4830
IF Kel,J»=63 TH~N 4860
K(J)OKCJ)+MeJ)
GO TO 4U0
K(I,J).KCI,J).35
PRINT Ca,NSCJ)," HAS ACCUMULATED AT LEAST &3 POINTS"
PRI~T "IN THE FIRST SIX CATEGORIES,"
PRINT "HE SCORES A BONUS Of 35 POINTS!"ICS
K(J)"K(J)+MCJ)
GO TO 4930
K(J)'K(J)+MCJ)
PRINT NBCJ)," HAS ",KCJ)," POINTS"
NEXT J
GO TO 1490
PRINT "IT IS ILLEGAL TO USE '" ZS," THIS ROUND" ,C $
GO TO 2620
PRINT
PRINT
PRINT
PRINT "INSTRUCTIONS FOR PLAYING YAHTZEE" ,C~
PUNT
PRINT "YAHTZEE MAY BE PLAYED BY UP TO 15 PEOPLE,"
PUNT "THE OBJECT OF THE GAME IS TO GET THE HIGHEST SCORE"
PRINT "EACH PLAYER ON HIS TURN RECEIVES FROM THE COMPUTER"
PRINT "THE VALUES OF THE 5 PSEUDO-DICE, HE MAY THEN ROLL"
PRINT "AS MANY OF THEM AS HI; WANTS TO AGAIN. HOWEVER,"
PUNT "HE 15 ENTIT~EO UP TO eUT NO MORE THAN THREE ROLLS"
PRINT "OFIHE DICE,"
PRINT"
YOU TELL THE COMPUTER MANY DICE YOU"
PRINT "WANT TO CHANGE. THEN I'ELL IT WHICH ONES IN THE P'O"-"
PRINT "LOWING MANNER I "
PRINT
PRINT' TYPE,
FOR THE 1ST DIE, '2' FOR THE 2ND, ETC'
PRINT"
AFTER THE THIRD ROLL THE PLAYER MUST DECIDE HOW"
PRINT "HE WANTS TO SCORE HIS FIVE DICE,"
PRINT "TYPING 'SUMMARY' ,,1"LL SHOW WHAT CATEGORIES"
PRINT "HAVE eE~N USED. OTHERWISE,"
PRINT "YOU HAVE 13 CHOICES, TYPE I or THE reLLOWING"
PRINT "DEPENDING ON HOW YOU WANT YOUR DICE SCORED."
PRINT "THE CHOICES AREI"
PRINT "ACES, TWOS, THREES, FOURS, rIVES. SIXES 11
PRINT "THflEE OF A KIND,FOUR or A KINO,FULL HOUSE, SM. STRAIGHT,"
PRINT "LG, STRAIGHT, YAHTZI~,CHANCE.'
PRINT "WHAT THE COMPUTER WILL 001"
PRINT "FOR ACES IT WILL COUNT AND ADD UL OF YOUR ONES,"
PRINT "FOR TWOS IT WILL COUNT AND ADD ALL OF YOUR TWOS,"
PRINT "THE SAME IS TRUE THROUGH THE SIXES"
PRINT "THREE OF A KIND WILl. TOUL ALL OF THE DICE PRO-"
PRINT "VIDEO THAT rou HAVE THREE or A KIND"
PRINT "P'OUR OF A KIND IS THE SAME AS THREE or A KIND EXCEPT"
PRINT "THAT YOU MUST HAVE FOUR OF A KINO"
PRINT "FULL HOUSE (3 'OF ONE NO, AND 2 OF ANOTHERl WI~L YIELD"
PRINT "25 POINTS, SM. STRAIGHT WILL GIV~ YOU 30 POINTS BUT"
PRINT "YOU MUST HAVE A S;:QUENCE OF FOUR."
PRINT "LG,STRAIGHT WILL YIELD 40 POINTS BUT YOU MUST HAVE A SE-"
PRINT "QUENCE OF FIVE,"
PRINT "YAHTZEE WIL~L GIVE 50 POINTS IF YOU HAVE FIV" OF A KIND,"
PRINT "CHANCE WILL TOTAL AI.L OF YOUR DICE AND USE THAT AS YOUR SCORE."
PRINT "CHANCE IS UaEFU~ "HEN YOU DON'T HAVE ANYTHING WORTH SCORING,"

'I'

5410 PRINT

hANOTH~R

CAT~GORY,

'ZERO' WILL

Z~RO

OUT A CATEGORY"

5420 PRINT lin' YOU DON'T HAVE ANYTHING \'lORTH SCOPH'GII

5430
5440
5450
5460
5470
5490
5490
5500
5510
5520
5530
5540
5550
5560
5570
5580
5600
5610
5620
5630
5640
5650
5660
5670
5680
5690
5710
5720
5730
5740
5750
5760
5770
578e

5790
5801?1
5810
5820
5830
5840
5850
5860
5870
5880
5890
5900
5910
5920
5930

PRINT "BUT HAH PERHAPS A~REAOY US!:.D YOUR CHANCE,"
PRIN'f
PRINT "IF YOUR ACCUMULAnO SCORE OF THE FIRST SIX CATEGORIES"
PRINT "EVER REACHES AT LEAST 63 POINTS YOU 'JILL RECEIVE"
PRINT "A BONUS OF 35 POINTSI",CS
PRINT
PRINT "FOR INSTRUCTIONS UURING THE RUNNING OF THE PROGRAM"
PRINT "TYPE 'WHAT?' WHEN THE COMPUTER ASKS FOR A WORD, OR."
PRINT"',01' WHEN IT WANTS A NUMBER. AND rou WILL RECEIVE"
PRINT "FURTHER NOTES RELATED TO WHAT THE COMPUTER ASKED FOR."
PRINT
PRINT
PRINT
PRINT "GOOD LUCKII!I!" ,CS
GO TO 1070
PRINT "WHAT DO YOU WANT ONE OF THE PLAYERS CALLED BY"
PRINT "HOW HAIr DICE DO YOU WANT TO ROLL AGHN",
RETURN
PRINT "WHICH DIE DO ~OU .ANT TO CHANGE"
PRINT "TYPE I
FOR THE 1ST DIE, '2' FOR THE 2ND DIE, ETC,"
RETURN
PRINT "IN WHICH CATEGORY DO YOU WANT THIS ROUND SCORED"
PRINT "TYPING' 'SUMMARY' WIl,L HLL YOU WHICH CATEGORIES YOU HAVE USED",
RETURN
PRINT "WHICH CATEGORY DO YOU WANT ZEROED"
GO TO 56&0
PRINT "A MAXIMUM OF 15 HUERS IS ALLOWED"
RETURN
PRINT "HOW MANY ~EOPLE WISH TO PLAY",
RETURN
IF lS'''ACES'' THEN 5880
IF ZS."TWOS" THEN 5900
IF ZS."THREES" THEN 5920
IP" ZS.I'FOURS" THEN 5940
IF ZS="FIVES" THEN 5960
IF Z'="SIXES" THr.:N S98~
IF ZS'''tHREE Ot' A KIND" THEN 6000
IF Ze"'FOUR OF A KIND" THEN 6020
IF ZS'''FULL HOUSE" THEN 6040
IF ZS-"SM, STRAIGHT" THEN 60.0
IF ZS'''LG, STRAIGHT" THEN b080
IF Za"'YAHTZEE" THEN 6100
IF ZS""CHANCE" THEN 6120
H(I,R)"1
GO TO 4710
HCl,R)-2
GO TO 4710
HCI,Rl.3
GQ TO 4710

'I'

SAMPLE RUN
19411 H(I,II)_4
5950 GO TO 4118
5960 H(I,R)-S
5970 GO TO 4710
5980 H(I,R)e6
5990 GO TO 4710
·eese H(I,R).7
6810 GO TO 4HI
6028 H(I,II)08
6030 GO TO 4710
6840 H(I,II)"9
e0S0 GO TO 4710
8060 H(I,R)eI0
ee78 GO TO 4718
e0ee H(I,II)-U
6098 GO TO 4710

HOW MANY PLAYERS [TYPE: '0' FOR INSTRUCTIONS) ?0

INSTRUCTIONS FOR PLAYING YAHTZEE
YAHTZEE MAY BE PLAYED BY UP TO 15 PEOPLE,
THE OBJECT OF THE GAME IS TO GET THE HIGHEST SCORE
EACH PLAYER ON HIS TURN RECE I YES FROM THE COMPUTER
THE VALUES OF THE 5 PSEUDO-DICE, HE MAY THEN ROLL
AS MANY OF THEM AS HE WANTS TO AGAIN, HOWEYER,
HE IS ENTI TLED UP TO BUT NO MORE THAN THREE ROLLS
OF THE DICE,
YOU TELL THE COMPUTER MANY DICE YOU
WANT TO CHANGE, THEN TELL IT WHICH ONES IN THE FOLLOWING HANNER:

6100 H(I,R)el~
6118 GO TO 4710

TYPE: '1' FOR THE 1ST DIE, '2' FOR THE 2ND, ETC
AFTER THE THIRD ROLL THE PLAYER HUST DECIDE HOW
HE WANTS TO SCORE HIS FIVE DICE,
TYP I NG 'SUMMARY' WI LLL SHOW WHAT CATEGOR I ES
HAVE BEEN USED, OTHERWI SE,
YOU HAVE 13 CHOICES, TYPE 1 OF THE FOLLOWING
DEPENDING ON ~OW YOU WANT YOUR DICE SCORED,
THE CHOI CES ARE:
ACES, TWOS. THREES. FOURS. FII,'ES, SIXES
THREE OF A KIND, FOUR OF A KIND, FULL HOUSE, 51'1, STRAIGHT.
LG, STRAIGHT. YAHTZEE, CHANCE,
WHAT THE COMPUTER WILL DO:
FOR ACES IT WILL COUNT AND ADD ALL OF ... OUR ONES,
FOR TWOS IT WILL COUNT AND ADD ALL OF YOUR TWOS,
THE SAHE IS TRUE THROUGH THE SIXES
THREE OF A KIND WILL TOTAL ALL OF THE DICE PROYIDED THAT YOU HAYE THREE OF A KIND
FOUR OF A KIND IS THE SAME AS THREE OF A KIND EXCEPT
THAT YOU MUST HAVE FOUR OF A KIND
FULL HOUSE [3 OF ONE NO, AND 2 OF ANOTHER). 101 I LL YIELD
25 POINTS, SM, STRAIGHT WILL GIVE YOU 30 POINTS BUT
YOU HUST HAVE A SEQUENCE OF FOUR,
LG, STRAIGHT WILL YIELD 40 POINTS ·BUT YOU HUST HAI,'E A SEQUENCE OF FIVE,
YAHTZEE WILLL GIVE 50 POINTS IF, YOU HAVE FII,'E OF A KIND,
CHANCE WILL TOTAL ALL OF ...OUR DICE AND USE THAT AS ...OUR SCORE,
CHANCE IS USEFUL WHEN "'OU DON'T HAVE ANYTHING WOIi:TH SCORING,
ANOTHER CATEGORY, 'ZERO' WILL ZERO OUT A CATEIlOR ...
IF YOU DON'T HAVE ANYTHING WORTH SCORING
BUT HAVE PERHAPS ALREAD... USED ... OUR CHANCE.

m: ~~If~):~':0

6148 PRln UCIlI" HAS USED THE FOLLOWING CATEGOUES,·
6150 FOR 581 TO (R-l)
6160 IF H(I,S»7 THEN 61S0

6170
6180
6190
6200
6210
6220
6230
6240
62U
6260
6270
6280
6290

ON H(I,S) GO TO 6190,6210,6U0,6250,6270,6290,6]U
ON H(I,S)_7 GO TO 6330,6350,6370,6390,6410,6430
PRINT "ACES, "
GO TO 6440
PRINT 'TWOS, "
GO TO 6440
PRINT "THREES, "
GO TO 6440
PRINT ·FOURS, '"
GO TO 6440
PRINT "FIVES, "
GO TO U40

6310
6320
6330
6340
6350
6360
6370
6380
6390
6400
6410

PRINT
GO TO
PRINT
GO TO'
PRINT
GO TO
PRINT
GO TO
PRINT
GO TO
PRINT

PRINT "51XES, '"
63e0 GO TO 6440
"THREE OF A KIND, ".
6440
"FOUR OF A KIND, ",

6440
"FULL HOUSE, "
6440

"SM. STRAIGHT, ",
6440

"LG. STRAIGHT, ",
.6440 '
"YAHTZEE, '"
6420 GO TO 6440

5410
6440
6445
6446
6447

PRINT "CHANCE, -,
NEXT 5
PUNT
PRINT "HE HAS -,KCI"" POINTS,"
PRINT "AND ",KCI,x)," OF THE &5 POINTS NEEDF,D FOR THE BONUS",
6450 PRINT ' . '
6460 RETURN
5470 OeS

6480 FOR X-I TO P
6490 IF S(X».S(X+I) THEN 6540
6500 HOS(X)
6510 SeXl.SCX.!)
6520 S(X.l)aH
6U0 Gol
6540 NEXT X
6550 IF -G>1 THEN 6470
6560 PRINT "THE GAME IS OVER."
6570 PRIn
6571 rOR Xel TO P
6572 IF K(X)eS(X) THEN 6580
657] NEXT X
6580 PRINT "THE WINNER IS ",nUl)," WITH ",K(!l," POINTS."
6585 IF pol THEN 9999
5586 PRINT 'OTHER FINAL SCORES AREI"
6590 FOR Y.I TO P
6600 IF K(Y).S(X) THEN 6620
6610 PRI~T NI(Y),' FINISHES WITH ",K(n," POINTS."
6620 NEXT Y
9999

IF YOUR ACCUMULATED SCORE OF THE FIRST SIX CATEGORIES
EVER REACHES AT LEAST 63 POINTS ,'Oll WILL RECEI'o'E
A BONUS OF 35 POINTS!
FOR INSTRUCTIONS DURING THE RUNNING OF THE PROGRAM
TYPE 'WHAT?' WHEN THE COMPUTER ASKS FOR A WORD. O~:,
',01' WHEN IT WANTS A NUMBER, AND ,'OU WILL RECEIYE
FURTHER NOTES RELATED TO WHAT THE COMPUTER ASKED FOR,

GOOD LUCK!!!!!

HOW HANY PLAYERS [TYPE: '0' FOR I NSTRUCTI ONS) ?2
NAME ?DAVE
NAME ?KEN
ROUND 1

DAVE'S TURN
YOU HAVE A 5 4 3 2 2
TH I 5 I S YOUR 2ND OF :;: ROLLS,
HOW MANY DO YOU WANT TO CHANGE 7, 01
HOW MAN ... DICE DO YOU WANT TO ROLL AGAIN ?1
WHICH ?5
YOU HAVE A 5 4 3 2 1
THIS IS YOUR LAST ROLL,
HOW MANY DO YOU WANT TO CHANGE 70
HOW DO YOU WANT THIS ROUND SCORED ?LG, STRAIGHT
DAVE YOU GET A SCORE OF 40 FOR THIS ROUND

~ND

KEN'S TURN
YOU HAVE A 5 4 4 2 1
THIS IS YOUR 2ND OF :;: ROLLS.
HOW MANI' DO YOU WANT TO CHANGE ?1
WHICH ?3
YOU HAVE A 5 4 2 2 1
THIS IS YOUR LAST ROLL.
HO'" MANY DO YOU WANT TO CHANGE ?1
WHICH ?3
YOU HAVE A 5 4 2 1 1
HOW DO YOU WANT TH I S ROUND SCORED ?TWOS
KEN YOU GET A SCORE OF 2 FOR THIS ROUND
DAVE HAS 40 PO I NTS
KEN HAS 2 POINTS
ROUND 2

241

DRVE'S TURN
YOU HAVE A 6 6 4 2' 1
THIS IS YOUR 2ND OF :;: ROLLS,
HOW HANY DO YOU WANT TO CHANGE ?l
WHICH ?3. 4. 5
WHICH ?4
WHICH ?5
YOU HAVE A 6 6 6:;::;:
THIS IS YOUR LAST ROLL,
HOW MANY DO YOU WANT TO CHANGE 70
HOW DO YOU WANT THIS ROUND SCORED ?FlILL HOUSE
DAVE YOU GET A SCORE OF 25 FOR THIS ROUND

KEN'S TURN
I'OU HAVE A 5 5 l
1 1
THIS IS I'OUR 2ND OF l ROLLS,
HOW HANI' DO I'OU WANT TO CHANGE ?1
WHICH 75
I'OU HAYE A 5 5 3 2 1
THIS IS I'OUR LAST ROLL,
HOW HANI' DO I'OU WANT TO CHANGE 71
WHICH 72
I'OU HAYE A 5 1 2 1 1
HOW DO I'OU WANT THIS ROUND SCORED 7ACES
KEN I'OU GET R SCORE OF 2 FOR THIS ROUND
DRVE HRS 65 POINTS
KEN HRS 4 POINTS
ROUND l

DRYE'S TURN
I'OUHRYER 6 5 4 4 1
THIS IS I'OUR 2ND OF 3 ROLLS,
HOW HRNI' DO I'OU WANT TO CHANGE ?2
WHICH 74
WHICH 75
I'OU HAVE R .. 5 5 5 4
THIS IS YOUR LAST ROLL,
HOW HRNY DO I'OU WANT TO CHANGE ?2
WHICH ?1
WHICH 75
I'OUHRYEA 5 5 5 5 3
HOW DO I'OU WANT THIS ROUND SCORED 7FOUR OF A KIND
DRVE I'OU GET A SCORE OF 23 FOR THIS ROUND
KEN'S TURN
YOUHRYEA .. 4 1 2 1
THIS IS I'OUR 2ND OF 1 ROLLS,
HOW MANI' DO YOU WRNT TO CHANGE 70
HOW DO I'OU WANT THIS ROUND SCORED ?SH. STRAIGHT
KEN I'OU GET A SCORE OF 30 FOR THIS ROUND
DAYE HAS 88 POINTS
KEN HAS 34 POINTS
ROUND 4

DRVE'S TURN
I'OU HAVE A .. 5 3 2 1
THIS IS I'OUR 2ND OF 1 ROLLS,
HOW MANI' DO I'OU WRNT TO CHANGE 71
WHICH ?1
I'OUHRYEA 5 : ; 1 2
THIS IS I'OUR LAST ROLL,
HOW /'IRNY DO I'OU WANT TO CHANGE ?1
WHICH ?1
I'OU HAYE A 5 5 ::I 2 1
HOW DO I'OU WRNT THIS ROUND SCORED ?FIVES
DRYE I'OU GET R SCORE OF 10 FOR THIS ROUND
KEN'S TURN
YOU. HAYE A 5 4 :1 2 1
TH I S ·1 S YOUR 2ND OF 1 ROLLS,
HOW HANY DO YOU WANT TO CHANGE 70
HOW DO YOU WANT THIS ROUND SCORED ?LG. STRAIGHT
KEN YOU GET A SCORE OF 40 FOR TH I S ROUND
DAVE HAS 98 POINTS
KEN HAS 74 POINTS
ROUND 5

DAVE'S TURN
YOU HAVE.A .. 6 1 3 2
THIS IS I'OUR 2ND OF 1 ROLLS,
HOW MRNI' DO YOU WANT TO CHANGE 71
WHICH 75
I'OUHAYER . . . . 4 3 3
THIS IS I'OUR LAST ROLL,
HOW /'IANI' DO YOU WANT TO CHANGE ?1
WHICH ?3
YOU HAYE R .. .. 5 3 l
HOW.DO YOU WRNT THIS ROUND SCORED ?SIXES
DAYE I'OU GET R SCORE OF 12 FOR TH 15 ROUND
KEN'S TURN
YOUHRYEA":;::1 2 2
THIS IS I'OUR 2ND OF 3 ROLLS,
HOW HRNI' DO YOU WANT TO CHANGE ?3
WHICH 71
WHICH2 7
WHICH ?3
I'OUHRYEA . . . . 4· 2 2
THIS IS I'OUR LAST ROLL,
HOW MANY DO YOU WANT TO CHANGE
WHICH ?3
WHICH 74
WHICH 75
YOU HAVE R 6 6 6 4 3
HOW DO YOU WANT THIS ROUND SCORED 7SIXES
KEN YOU GET R SCORE OF 18 FOR THI S ROUND

n

DAVE HAS 110 POINTS
KEN HAS 92 POINTS

KEN'S TURN
I'OUHAI'ER 5 3 2 2 1
THIS IS YOUR 2ND OF 3 ROLLS,
HOW /'IANI' DO YOU WANT TO CHANGE ?1
WHICH ?3
I'OUHRYER 6 5 3 2 1
THIS IS I'OUR LAST ROLL,
HOW MRNI' DO I'OU WANT TO CHRNGE 71
WHICH 71
I'OU HAilE A 5 l
2 1 1
HOW DO YOU WANT THIS ROUND SCORED ?SUMMARI'
KEN HAS USED THE FOLLOWING CATEGORIES:
TWOS, ACES, SM. STRAIGHT, LG. STRAIGHT, SIXES, FIVES,
L HOUSE, THREE OF A KIND,
HE HRS 151 POINTS,
AND 45 OF THE 65 PO I NTS NEEDED FOR THE BONUS.
HOW DO I'OU WRNT THI S ROUND SCORED 7CHANCE
KEN.I'OU GET R SCORE OF 12 FOR THIS ROUND

THREES,

FOURS,

FUL

DAYE HAS 182 POINTS
KEN HAS 163 POINTS
ROUND 12

DAYE'S TURN
I'OUHAYEA 6 4 4 3: 2
TH I SIS I'OUR 2ND OF 3: ROLLS,
HOW MANY DO I'OU WANT TO CHRNGE ?2
WHICH 71
WHICH ?2
YOU· HRVE R 6 4 3 3: :;:
THIS IS I'OUR LAST ROLL,
HOW MAN I' DO I'OU WANT TO CHANGE 72
WHICH 71
WHICH ?3
I'OUHAVEA 4 3 2 2:;:
HOW DO I'OU WRNT THIS ROUND SCORED ?SH. STRAIGHT
DAVE YOU GET A SCORE OF 3:0 FOR THIS ROUND
KEN'S TURN
YOU HRVE R 6 4 4 1 1
THIS IS YOUR 2ND OF ::I ROLLS,
HOW MANY DO YOU WANT TO CHA"IGE ?J:
WHICH 71
WHICH ?4
WHICH 75
YOU HAVE A 5 4 4 2 1
THIS IS I'OUR LAST ROLL,
HOW MANI' DO YOU WRNT TO CHANGE
WHICH 71
WHICH ?4
WHICH 75
I'OUHRYEA 5 4 4 4 3:
HOW DO I'OU WANT THIS ROUND SCORED ?ZERO
",HRT DO I'OU WRNT TO ZERO 7YAHTZEE
KEN YOU GET A SCORE OF 0 FOR THIS ROUND

n

DAVE HRS 212 POINTS
KEN HRS 163 POINTS
ROUND 13

DAVE'S TURN
I'OU HAVE A 5 4 3 1 1
TH I SIS I'OUR 2ND OF 3: ROLLS,
HOW MANI' DO I'OU WANT TO CHANGE ?:l:
WHICH ?1
WHICH 72
WHICH ?3
YOU HAVE R 5 2
1 1
TH I SIS I'OUR LAST ROLL,
HOW MANI' DO I'OU WANT TO CHANGE ?2
- WHICH 71
WHICH ?2
I'OU HRVE A 4 3: 1 1 1
HOW DO I'OU WANT TH I S ROUND SCORED ?ZERO
WHAT DO YOU WANT TO ZERO ?I'RHTZEE
DRVE YOU GET A SCORE OF 0 FOR THIS ROUND
KEN'S TURN
YOU HAYE A .. 6 5 4 2
TH I SIS I'OUR 2ND OF 3 ROLLS,
HOW /'IRNY DO YOU WANT TO CHANGE ?3
WHICH
WHICH 74
WHICH ?5
YOU HAVE A 6 6 ,; 4 2
THIS IS I'OUR LAST ROLL,
HOW HANI' DO YOU WRNT TO CHANGE 12
WHICH ?4
WHICH 75
YOU HAVE A 6 '" 6 5 2
HOW DO I'OU WANT THIS ROUND SCORED ?ZERO
WHRT DO YOU WANT TO ZERO 7FOUR OF A KIND
KEN I'OU GET A SCORE OF 0 FOR THIS ROUND

n

DRVE HAS 212 POINTS
KEN HRS 163: POINTS
THE GRME I S OVER.
THE WINNER IS DAVE WITH 212 POINTS.
OTHER FINRL SCORES RRE:
DRVE FINISHES WITH 212 POINTS.
KEN FINISHES WITH 163 POINTS.

242

\

'

j

1";

!.l
I!,
i.
,.

ZOOP

BASIC PROGRAMMER'S NIGHTMARE

Description
ZOOP is designed to imitate the system commands of a BASIC
compiler, however, it gives totally meaningless and frustrating
results. For example, to the command:
CAT
ZOOP responds with:
TRY MONTGOMERY WARD's
To the command:
SCRATCH
ZOOP responds with:
GOT AN ITCH?
Computer Limitations

I

The version of ZOOP printed here was written for DIGITAL
Edusystems 15/30/35 and immediately decodes the first two
characters input and carries on from there. It is a simple
matter to convert ZOOP to a system which has string handling,
however, it was felt that this version is more creative. It
also happens to be the original.

I
:1

Program Author
Tom Kloos
oregon Museum of Science and Industry
Portland, Oregon 97200
100PRINT\PRINT"READY'\PRINT
110 INPUT SA\IF "i53 THEN 300\INPUT 18\IF "253 THEN 300
liIJLET~·10 .• '.8
13IJI~Kc.2313THENI40\PRINT·N
NO FILE YOU 8008"\GOTOI00
140I~Kc.214]THENIS0\PRINT·TALOG
TRY ~ONTGDHERY WARD'S"\GOTOI0~
15IJIFKc.224ITHENlb0\PRINT"STNH I bOH'T FEEL LIKE IT"\GOTOI00
I&IJIFKc.2257THENI10\PRIHT"W YES I'M QUITE NEW"\GOTOI00
ITIJI'~c.iiT4THlNI90\PRINT"D I'M NOT THAT OLD, BUT· I'M OLD ENOUGHSSS"
180GOT0100
I.IJIFKc.Z29TTHEH2IIJ\PRINT"NAME WHY? I LIKE MY NAME"\GOTOIIJ0
200I~Kc.2eTTHEN210\PRINT·NAME
WHY? I LIKE MV NAME"\GOTOI00
210IFKc.2t57THEN220\PRINT"SUG GET A CAN OF RAID"\GOTOI00
U0IFKoU2i/THENZU\PRINTI'OP THE FUN 18 JUST STARTINC'\GOTOlfI0
230I'Kc.2303THENi/40\PRINT"VE I DON'T LIKE BANKS"\GOT01BI
240IFKc.Z33&THEN250\PRINT"SAVE O,K" THE WHOLE DEC TAPE"\CHAIN .ZOOP
25IJI'Kc.Z305THEN2&0\PRINT"RATCH GOT AN ITCH7"'GOTDlee
2&0I'Kc>21 •• THEN210\PRINT"IT THIS IS NO NEWSPAPER"\GOTOI00
270 INPUT IC\I' C02S] THEN 300
i8eI~Cc>14ITHEN270

29'PRINT\PRINT·~HAT17·'GOTOI0'

300 PRINT • WIPED OUT CO"PLETELYSII"
310 CHAIN "DEMON •
320END

243

•

Appendices

245

J

~

Iii
IV
If'

APPENDIX A,
FAMILIES OF GAMES
Number or Letter
Guessing
1. GUESS
2. HI-LO
3. LETTER
4. 'l'RAP
5. STARS
Piles of Objects
1. 23MTCH
2. BATNUM
3.

EVEN

4.

NIM

Matrix
BATTLE
HURKLE
MUGWMP
PIZZA
SALVO
SALVO 1
Cybernetics (Artificial
Intelligence)
ANIMAL
DIGITS
EVEN 1

HEX
Land Management,
Government,' History
CIVILW
FURS

Logic
AWARI
BAGLES
BULCOW
CHOMP
CUBE
FIPFOP'
HI-Q
lCHECK
QUBIC
QUEEN
REVRSE
TICTAC
TOWER

Plotting
BOUNCE
BUNNY

DIAMND
SNOOPY (2)
3 DPLOT
UGLY

CAl, Quiz
CHEMST
CHIEF
HELLO
KINEMA
LITQZ
MATHDI
TRAIN

Casino, Gambling,
Betting
BINGO
BLKJAK, BLKJAC
CRAPS
DOGS
HORSES
POKER
ROULET
SLOTS

War
BOAT
BOMBER
GUNNER, GUNERl

Card and Board
A,CEYDU
CHECKR
GOMOKO
MNOPLY
WAR.
YAHTZE

Dates
CALNDR
WEKDAY

HMRAnI

KING
STOCl<

Space
ORBIT
ROCKET, ROCKT1, ROCKT2
SPACWR
TARGET

Sports
BASBAL
BASKET
BOWL
BOXING'
BULEYE
CANAM
FOOTBL, FOTBAL
GOLF
HOCKEY

247

Word
BUZZWD
HANG
SYNONM
WORD

Miscellaneous
AMAZIN
BUG
BULL
CHANGE
DICELIFE
LIFE-2"
NUMBER
POETRY, POET
ROCKSP
RUSROU
SPLAT
ZOOP.

APPENDIX B - GAME DIAGRAMS
Grids for playing BATTLE, HURKlE , MUGWMP, and SALVO.

N

N

10------~------------

10--------~~~~~--~

9~~~~~~~~~~

9~~~~+-+-+-+-+-+-~

8~~~~~~~~~~

8~~~~+-+-+-+-+-+-~

7~~~~~~~~~~

7~~~~+-+-+-+-+-+-~

6~~~~~~~~~~

6~~~+-+-+-+-~+-~~

W5~~~~~~~~~~E

W5~~r-T-+-+-+-~+-~~E

4~~~~~~~~~~

4~~r-+-+-+-+-~+-~~

3~~~~~~~~~~

3~~r_T_+_+_+_~+_~~

2~~~~~~~~~~

2~~r_T_+_+_+_~+_~~

1~~~~~~~~~~

1~~r-+-+-+-+-~+-~~

00 1 2 3

4 5 6

00 1 2 3 4 5

7 8 9 10

S

6 7 8 9 10

S

I

I

o

1 2 3 4 5· 6

I

I

I

I

I

I

I

7 8

I

I

I

I

I

I

I

9 10 11 12 13 14 15

Use this scale with a compass for MUGWMP.

Diagram for playing QUBIC.

(1) Level 1

Level 2

Level 3

Level 4

1
(2)
Row

2
~

3
4

-t--If---If--

----It--t---t-

1

2 3 4

1

2 3 4

(3) Column

Blanks for playing DIGITS

1st 10
2nd

10

3rd 10
248

12

3 4

1 2 3

4

,.
I

I.

APPENDIX C
INSTRUCTIONS TO GAME AUTHORS
1.

Programs must be complete and debugged, BASIC language only.

2.

Please submit':
A. One program listing and
B. Two sample runs the wayan average person would play.

3.

Listing and run must be on white, unlined paper. If you have
lined paper, turn it around to the unlined side. We
absolutely cannot handle submittals on pink, yellow, blue
or gray paper. Xerox, Ditto, or other copies are also
unacceptable. Make as few folds in the output as possible.

4.

Listing and run must be done with a fresh black ribbon.
Not a purple or blue ribbon and especially not a used
ribbon.

5.

The Teletype type ball must be clean and produce crisp copy.
Clean the ball with typewriter type cleaner or a stiff
toothbrush.

6.

If possible, submit a paper tape of the program. Unoiled
fan-fold tape is preferable. If you have oiled paper tape
(as from a Teletype), fan fold it (folds are 8~" apart),
leave at least 17" blank leader and 8~"trailer tape.
Rolled paper tape or fan folds much greater or less than
8~" cannot be handled on our high-speed readers and are
unusable for making copies. Be ~ to wrap oiled paper
tape in kitchen plastic wrap or waxed paper when you mail
it.
If you don't the oil seeps out and smears the output.
Oil seepage has ruined any number of otherwise excellent
submittals.

7.

We also have to know:
A. Your name
B. Complete address
C. Telephone
D. School affiliation

J
I

I

i
I

8.

By submitting a
Corp. the right
your program in
be cited as the

E.

F.
G.

Your age
Computer system used
Original source of program
(if not you)

program, you are giving Digital Equipment
to publish, reprint, distribute, or use
any other way. You will, of course, always
author.

249

) ...

I"

DIGITAL EQUIPMENT CORPORATION, COrporate Headquarters: Maynard, Massachusetts 01754, Telephone: (617) 897-5111
SALES AND SERVICE OFFICES~
DOMESTIC -

ARIZONA, Phoenix and Tucson. CALIFORNIA, Los Angeles, Monrovia, Oakland, Ridgecrest, San Diego, San Francisco

(Mountain View), Santa Ana, Sunnyvale and Woodland Hills. COLORADO, Englewood. CONNECTICUT, Fairfield and ~iden • DISTRICT OF
COLUMBIA, Washington

(Latha~m,

Md.) • FLORIDA, Orlando. GEORGIA, Atlanta. ILLINOIS, Chicago (Rolling Meadows). INDIANA,

Indianapolis. IOWA, Bettendorf. KENTUCKY, Louisville. LOUISIANA, Metairie (New Or1eans) • MASSACHUSETTS, Marlborough and,
Waltham. MICHIGAN, Detroit (Farmington Hills) • MINNESOTA, Minneapolis. MISSOURI, Kansas City and St. Louis. NEW HAMPSHIRE,
Manchester. NEW JERSEY, Fairfield, MetUchen and Princeton. NEW MEXICO, Albuquerque. NEW YORK, Albany, Huntington Station,
Manhattan, Rochester and Syracuse. NORTH CAROLINA, Durham/Chapel Hill • OHIO, Oeveland, Columbus and Dayton. OKLAHOMA,
Tulsa. OREGON, Portland. PENNSYLVANIA, Philadelphia (Bluebell) and Pittsburgh. TENNESSEE, Knoxville • TEXAS,
Austin, Dallas and Houston • UTAH, Salt Lake City •

WASHIN~TON,

Bellevue • WISCONSIN, Milwaukee (Brookfield) •

INTERNATIONAL - ARGENTINA, Buenos Aires. AUSTRALlA,Adelaide, Brisbane, Canberra, Melbourne, Perth and Sydney. AUSTRIA,
Vienna. BELGI UM, Brussels. BOLIVIA, La Paz. BRAZIL, Puerto Alegre, Rio de Janeiro and Sao Paulo. CANADA, Calgary, Halifax, Montreal
Ottawa, Toronto and Vancouver -CHILE, Santiago. DENMARK, Coperihagen. FINLAND, Helsinki. FRANCE, Grenoble and Paris. GERMANY,
Berlin, Cologne, Hannover, Frankfurt. Munich and Stuttgart. HONG KONG. INDIA, Bombay. INDONESIA, Djakarta. ISRAEL, Tel Aviv
• ITALY, Milan and Turin. JAPAN, Osaka and Tokyo. MALAYSIA, Kuala Lumpur. MEXICO, Mexico City. NETHERLANDS, The Hague
• NEW ZEALAND, Auckland. NORWAY, Oslo. PHILIPPINES, Manila • PUERTO RICO, Santurce • SINGAPORE. SPAIN, Barcelona
and Madrid

•

SWEDEN, Stockholm

•

SWITZERLAND, Geneva and Zurich

• TAIWAN, Taipei and Taoyuan • UNITED

KINGDOM, Birmingham, Bristol, Dublin, Edinburgh, Leeds, London, Manchester and Reading

•

VENEZUELA, Caracas •

'"eor-

"o
.,"'



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2012:06:25 17:31:51-08:00
Modify Date                     : 2012:06:25 17:59:37-07:00
Metadata Date                   : 2012:06:25 17:59:37-07:00
Producer                        : Adobe Acrobat 9.51 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:b2a3452f-46aa-41e2-a188-a6f70a663650
Instance ID                     : uuid:ebdf299e-33ed-4060-bab1-af942665b2a0
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 252
EXIF Metadata provided by
EXIF.tools

Navigation menu