jsbasic/samples/sample.hireswalk.txt

35 lines
936 B
Plaintext
Raw Normal View History

2012-02-09 03:13:44 +00:00
10 HGR
20 X=140: Y=80
30 C=INT(RND(1)*8)
40 BR=3
40 HCOLOR=C: HPLOT X,Y: HPLOT X-1,Y-1: HPLOT X+1,Y+1
50 HPLOT X+1,Y-1: HPLOT X-1,Y+1
60 HPLOT X+1,Y: HPLOT X-1,Y: HPLOT X,Y+1: HPLOT X,Y-1
70 IF RND(1)>=.9 THEN C=INT(RND(1)*8)
80 IF RND(1)>=.9 THEN BR=BR + INT(RND(1)*3) - 1
90 IF BR<1 THEN BR=1
100 IF BR>7 THEN BR=7
110 NX = X + INT(RND(1)*15) - 7
120 NY = Y + INT(RND(1)*15) - 7
130 IF NX > 279 THEN NX=279
140 IF NX < 0 THEN NX=0
150 IF NY > 159 THEN NY=159
160 IF NY < 0 THEN NY=0
170 HCOLOR=C
180 FOR I=-INT(BR/2) TO INT((BR+1)/2)
190 FOR J=-INT(BR/2) TO INT((BR+1)/2)
200 X1=X+I: X2=NX+I: Y1=Y+J: Y2=NY+J
210 IF X1>279 THEN X1=279
220 IF X1<0 THEN X1=0
230 IF X2>279 THEN X2=279
240 IF X2<0 THEN X2=0
250 IF Y1>159 THEN Y1=159
260 IF Y1<0 THEN Y1=0
270 IF Y2>159 THEN Y2=159
280 IF Y2<0 THEN Y2=0
290 HPLOT X1,Y1 TO X2,Y2
300 NEXT: NEXT
310 X=NX: Y=NY
320 GOTO 70