I just learned that the for step parameter can be variable

5

SP4CEBAR 2025-02-04 16:07 (Edited)

I can now make this tiny program that lists the powers of two. Can anyone beat it?

FOR I=1 TO 2^23 STEP I
  PRINT I,
NEXT I


Sylveon 2025-02-04 17:25

Ok :3

DIGIT=10
RESULT=2^DIGIT

:3


nathanielbabiak 2025-02-05 00:55

I'm very impressed! I haven't thought of this! This idea is fast!


Timo 2025-02-05 13:25

Didn't think about it either :O
I wonder if any other BASIC dialect can do this, too :)


Sylveon 2025-02-05 14:07

Thx :3


qwaffe 2025-04-20 05:32

a not short fibonacci:

J=0
FOR I=1 TO 7^8 STEP J
 ADD J,I
 PRINT I,J,
NEXT I


Log in to reply.