From ce63c91ff33fcb9e5f71a8981f13942f48ed3f09 Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Wed, 5 Jan 2022 16:25:41 -0600 Subject: [PATCH] Shorter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- MATWEEX | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MATWEEX b/MATWEEX index de1b30f..45b9e56 100644 --- a/MATWEEX +++ b/MATWEEX @@ -1,5 +1,2 @@ -1POKE 35,25:DIM K(3,2):C=-1:A=0 -2C=(C+1)-INT((C+1)/3)*3:R=INT(RND(1)*A):IF C=2 THEN A=20 -3IF R=0 THEN K(C,0)=INT(RND(1)*40)+1:K(C,1)=0:K(C,2)=INT(RND(1)*2):GOTO2 -4K(C,1)=K(C,1)+1:IF K(C,1)<25THEN HTAB K(C,0):VTAB K(C,1):PRINT CHR$(INT(RND(1)*96*K(C,2)+32)); -5GOTO2 +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