apple-ii-matrix/MATWEEX
Brendan Robert ce63c91ff3
Shorter
Also preserves the original features where some threads are spaces and not characters.  The loop forever is accomplished with a never-ending for loop allowing the init line to be combined with the start of the main loop.  Next statements work the same as GOTO but they allow jumping back to the middle of a line. 😄  The INT statements are mostly unnecessary since apple basic treats everything as floating point and it is the functions themselves that strip off the mantissa and use the integer portion.  If you run a value through INT and store it into a variable, it will be converted back to float anyway so it just wastes CPU cycles.  I do use INT in one place to normalize a value as 0 or 1, and that is also how I eliminate an if statement by just multiplying the result by 96 -- it will either be 0 (space) or some other character as a result, etc.
2022-01-05 16:25:41 -06:00

3 lines
251 B
Plaintext

1 HOME:POKE 35,25:DIM K(3,2):Z=0:FOR D=0 TO 2:FOR C=0 TO 3:D=1:R=RND(1)*Z:IF R<1 OR K(C,1)>23 THEN K(C,0)=RND(1)*40+1:K(C,1)=0:K(C,2)=INT(RND(1)*2)*96:NEXT C:Z=20:NEXT D
2 K(C,1)=K(C,1)+1:VTAB K(C,1):HTAB K(C,0):PRINT CHR$(RND(1)*K(C,2)+32);:NEXT C,D