aboutsummaryrefslogtreecommitdiffstats
path: root/sc126/BASIC/COUNTUP.BAS
blob: 1a0710cd84259b0f6cef980e46626161a3568153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
10 RANDOMIZE SEED
20 AR = INT(RND*256) : BR = INT(RND*256) : CR = INT(RND*256) : DR = INT(RND*256)
 : LR = INT(RND*256)
25 DELAY = INT(RND*10000)
30 SEED = INT(RND*100)
40 OUT &H20, 0 : OUT &H21, 0 : OUT &H22, 0 : OUT &H23, 0 : OUT &HD, 0
50 GOSUB 100
52 GOSUB 200
54 GOSUB 300
56 GOSUB 400
58 GOSUB 500
70 IF A = AR AND B = BR AND C = CR AND D = DR AND L = LR THEN GOTO 1010
90 GOTO 50
100 IF A = AR THEN RETURN
110 LET A = A + 1
120 OUT &H20, A
130 RETURN
200 IF B = BR THEN RETURN
210 LET B = B + 1
220 OUT &H21, B
230 RETURN
300 IF C = CR THEN RETURN
310 LET C = C + 1
320 OUT &H22, C
330 RETURN
400 IF D = DR THEN RETURN
410 LET D = D + 1
420 OUT &H23, D
430 RETURN
500 IF L = LR THEN RETURN
510 LET L = L + 1
520 OUT &H0D, L
530 RETURN
1000 REM RANDOM DELAY LENGTH
1010 FOR Z = 0 TO DELAY : NEXT Z
1020 A = 0 : B = 0 : C = 0 : D = 0 : L = 0
1030 GOTO 10