Radio Shack TRS-80 PC-3 Owner's Manual page 203

Table of Contents

Advertisement

60: FOR I = 1 TO S
70: FOR
J
=
1 TO S
80: F (S, S) = 0
90: NEXT
J
100: NEXT I
110: FOR 1=1 TO B
120: X = RNO (S)
130: V
=
RNO (S)
140: IF ((X + V)
<
5) THEN GOTO 120
150: IF (((1
+
S - X)
+
(1
+
S - V))
<
5) THEN GOTO 120
160: F (X, V) = 1
170: NEXT I
180: F (S, S) = 9
190: X
=
1 : V = 1
200: PRINT "VOU ARE AT (";X;", ";V;")"
210: GOSUB 400
220: BEEP C
230: INPUT "WHICH WAY NOW? ";A$
240: 0
=
VAL (A$)
250: IF ((0
<
1) OR (0) 9)) THEN PRINT
"1 TO 9 ONL V, PLEASE" : GOTO 280
260: IF (0) 6) THEN GOSUB 500
270: IF (0
<
4) TH EN GOSUB 550
280: IF ((0 = 3) OR ((0= 6) OR (0 = 9)) THEN GOSUB 600
Loop through entire array and set each entry to zero - Needed to clear out
mines from prior games
Loop for number of mines
Get random X coordinate
Get random Y coordinate
Check it too close to starting corner
Check if too close to ending corner
Mark mine
Mark goal
Set start to (1, 1)
Start of turn - show location
Count the number of nearby mines
Beep to indicate number of nearby mines
Ask for direction from numeric pad
Convert keystroke to number
If not from numeric pad, then ask again
If from top row then GOSUB to north subroutine
If from bottom row, then GOSUB to south subroutine
If from right side, then GOSUB to east subroutine
203

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents