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

Table of Contents

Advertisement

220: FOR I = 1 TO 3
230: R(O = B + RNO (C)
240: IF (R(O > M) THEN LET M = R(I)
250: NEXT I
260: WAIT F
270: E = (G-F)/(M-C)
280: FOR A = 1 TO M
290: IF (A> C) THEN WAIT F + ((A-C)* E)
300: FOR 1= 1 TO 3
310: IF (R(I»O) THEN LET 0(1) = 0(1)
+
1
320: IF (O(l»T) THEN LET 0(1) = 1
330: R(I) = R(I)-1
340: NEXT I
350: PRINT P$(0(1); P$(0(2); P$(O(3)
360: NEXT A
370: WAIT H
380: PRINT P$(O(1); P$(0(2)); P$(0(3))
390: W =-1
400: IF (0(1) = 0(2») AND (0(2) = 0(3)) THEN LET W = Z
410: IF W<O THEN PRINT "YOU
LOSE"
420: IF W>O THEN PRINT
"YOU~WIN";
Z;
"DOLLARS"
430:S =S
+
W
440: ON (2t SGN (S») GOTO 450, 470, 490
450: PRINT ·S0L-..lARL_YOUJAVEJOST $"; ABS (S)
460: GOTO 500
Determine random stopping time for each window
Set M to longest stopping time
Reset WAIT to fastest interval
Compute the amount to slow the interval
during each turn of the slow down phase
Loop from 1 to longest stopping time
If in slow-down phase, then slow down rotation by one increment
Loop through each window
If window it still turning, then
advance
to next object
Cycle back to first object if
over
top
Reduce count of remaining turns
Show current objects
Reset WAIT to longest interval
Redisplay ending position
Set winnings this turn to expected loss of $1
If all objects are the same, then set to win amount
If loss, then say so
If win, then say so
Add this turn to total winnings
Jump to message depending on sign of winnings
Message for S<O
Go to common end
192

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents