LET S=S+50 without the LET

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
Shaun_B
Posts: 451
Joined: Wed Apr 22, 2009 10:22 am

LET S=S+50 without the LET

Post by Shaun_B » Wed Mar 07, 2018 4:13 pm

Consider this BASIC:

Code: Select all

  10 FOR S=-CODE "M" TO NOT PI STEP CODE "M"
  20 NEXT S
  30 PRINT AT NOT PI, NOT PI;"SCORE: ";S
  40 NEXT S
  50 GOTO 30
It works on EightyOne - in other words, each time you "NEXT S" you increase the S variable by the number specified in the "STEP" in line 10 (in this case 50)

I think this could be a byte-saver if used currectly.

Regards,

Shaun.

User avatar
XavSnap
Posts: 762
Joined: Sat May 10, 2008 4:23 pm

Re: LET S=S+50 without the LET

Post by XavSnap » Wed Mar 07, 2018 8:57 pm

:shock:
Cool...

Post Reply