/[james]/archive/graphical/RandWalk
ViewVC logotype

Contents of /archive/graphical/RandWalk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 28 - (show annotations) (download)
Fri Mar 14 14:57:29 2003 UTC (21 years, 9 months ago) by james
File size: 941 byte(s)
Initial import.

1 REM > RandWalk
2
3 ON ERROR ON ERROR OFF: OSCLI"ScreenSave RandImage": REPORT: PRINT "("+STR$ERL+")": END
4
5 MODE MODE
6 OFF
7
8 s% = 2
9
10 x% = 400
11 y% = 300
12
13 b% = &FF
14 g% = &FF
15 r% = &FF
16
17 REPEAT
18 REM ColourTrans_SetGCOL (3-351)
19 SYS &40743, (b% << 24) + (g% << 16) + (r% << 8)
20 CIRCLE FILL x% * 2, y% * 2, 4
21
22 CASE RND(8) OF
23 WHEN 1: y% += s%
24 WHEN 2: x% += s%: y% += s%
25 WHEN 3: x% += s%
26 WHEN 4: x% += s%: y% -= s%
27 WHEN 5: y% -= s%
28 WHEN 6: x% -= s%: y% -= s%
29 WHEN 7: x% -= s%
30 WHEN 8: x% -= s%: y% += s%
31 ENDCASE
32 IF x% < 0 THEN x% = 800
33 IF y% < 0 THEN y% = 600
34 IF x% > 800 THEN x% = 0
35 IF y% > 600 THEN y% = 0
36
37 IF RND(2) = 1 THEN c% = 4 ELSE c% = -4
38 CASE RND(3) OF
39 WHEN 1: b% += c%
40 WHEN 2: g% += c%
41 WHEN 3: r% += c%
42 ENDCASE
43 IF b% < 0 THEN b% = 0
44 IF g% < 0 THEN g% = 0
45 IF r% < 0 THEN r% = 0
46 IF b% > &FF THEN b% = &FF
47 IF g% > &FF THEN g% = &FF
48 IF r% > &FF THEN r% = &FF
49
50 UNTIL 0
51

  ViewVC Help
Powered by ViewVC 1.1.26