Radio Shack TRS-80 User Manual page 212

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

170
N=5715
180
P."
SEE THE
TERMITES
EAT.
185
P.AT4S,"
BITES LEFT!")
200 X=RND<
127)
220 Y=RND<45)
+
2
300
IF
POINT(
X
,
Y
>=0
G.200
500 RESET(X.Y)
550 N=N-1
600
P.AT36.Nj
700
IF
N=0 G.999
800
G.200
999
G.999
ONLY"
i
Sorry
SORRY
is
a
popular board
game
by
Parker
Brothers.
This
program
demonstrates
how
to
load
a
deck of
cards into
a
numerical
array,
draw
them
out
in
a
random
fashion, "reshuffle" the
deck
after the
last
card
is
drawn, and continue drawing.
You may
specify
how many
seconds delay
you
wish
between
each drawing of
the
cards,
allowing
as
much
time
as
desired
to
actually
move
the pieces
on
your
own
SORRY
board.
Have
fun!
10
REM
*
RANDOM GENERATOR
FOR
GAME
OF
SORRY
*
11
IN.
"ENTER
A
NUMBER FROM
1
TO
100"
|N
12
F.
1=1
TO
Ni
J=RND< 32767)
iN
.
I
15
CLS
20
P."
STAND
BY FOR THE
SHUFFLING
OF THE
DECK
OF
CARDS.
21
P
.
22
P.
30
P.
40 FOR
N=l
TO
45
50
READ
A{N)
60
NEXT
N
66
P.lP.iP.
70 Y=l
75 P.
"
SHUFFLING COMPLETED
,
.
.
GAME
CONTINUES!"
80
B
=
90
GDTG
110
100
S=35
1 1
R=INT(
RNDI
45
)
)
120
M=A(R
)
130
IF
M=0 GOTO
1 1
140 A(R)
=
150
T=0
160
FOR
Z=l
TO
45
170
T=A<Z)
+
T
180
NEXT
Z
185
P. T.
(27),
"PRESS
ENTER
"
f
t
IN.
A
I
190
IF
T=0
GOTO210
200
GOTO
240
210
P
.
"
END
OF
DECK.
THE CARDS ARE BEING
RESHUFFLED."
220
RESTORE
230 GOTO
30
240
IF
Y
<
G.270
2
50
P
.
TAB
(
10
)
!
"
RED
"
260
GOTO 280
£70
P.
TAB(40);" GREEN"
280
IF M
=
13
GOTO
300
290
P
.
TAB(B+1
5)
|M
300 ON
M
GOTO
3
20
,
3 4
,
59
,
3 8
,
590
,
590
,
4
00
,
59
,
5 9
,
4
30
,
4
50
,
59
,
4 7
310
GOTO
590
320
P.TAB(B)i"MAY
MOVE
A
NEW PIECE
OUT"
330
GDTD 590
3*0
P.TAB(B);"
MAY MOVE
A
NEW
PIECE OUT"
345
P.
i
P
.
350
P.
TAB<B+5)i"DRAW
AGAIN
.
.
.
-
"
210

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents