Brownian Motion (8K)

Author(s): Paul Ezra
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v2 n12 (Volume 2, Issue 12)
Date: December 1981
Pages: 2

Watch the Brownian motion of particles on your ZX81 or 8K ZX80. This random path program uses the line generator, p.87 in the ZX81 manual (p.121, 8K ROM manual). GOSUB 1000 calls that subroutine. Note the end (C,D) of one path begins another (A,B). Line 70 acts as a GOTO 25 command. Vary line 25 to change the amount of path. Insert 65 PAUSE 30 to watch the paths generate on an 8K ZX80.

  10 LET A=INT (RND*62)+1
20 LET B=INT (RND*42)+1
25 FOR P=1 TO 25
30 LET C=INT (RND*62)+1
40 LET D=INT (RND*30)+1
45 GO SUB 1000
50 LET C=A
60 LET D=B
70 NEXT P
Syntactic Sum: 32543, 8K

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.