On 1/4/23 11:03 PM, John R. Hogerhuis wrote:
Nice work :-)
Thanks John!
It had been a while since we had a new one-liner, and I thought this
looked like a good candidate.
And actually, I discovered I was only off by 1 character from fitting in
the 255 max line length with the "DEFINTA-Z:" included.
This can be fixed in one of two ways (or both):
1. Make the line number 1 instead of 10, thus saving 1 character
2. Change the FORX=1TO1 loop at the end to use "NEXT" instead of
"NEXTX", thus saving one character
I did both, and can now include all of the original program. So the
final version is:
1DEFINTA-Z:A=255:DIMW(A):FORJ=128TOA:W(J)=1:NEXT:B=30481:C(0)=A:C(1)=239:FORD=32TOA:CLS:FORJ=1TO7:PRINTJ:NEXT:PRINT8;:FORI=2TO6+W(D):C=PEEK(B):B=B+1:FORJ=0TO7:L=CAND1:C=C\2:PRINT@J*40+I,CHR$(C(L));:NEXTJ,I:FORX=1TO1STEP0:IFINKEY$=""THENNEXTELSEBEEP:NEXTD
Interestingly I also discovered the max line length can be fixed by
using '?' instead of the word "PRINT", and it will work. However when
you EDIT the program, the '?' is expanded back to PRINT again and the
expansion is larger than 255 characters, creating an incorrect program.
So I didn't opt for that solution.
Ken