Skip to main content
Noticed a small thing whereby I could save one BASIC token on two of the methods here
Source Link
Shaun Bebbers
  • 2.4k
  • 18
  • 22

Commodore BASIC, method 1 (28 bytes)

0?1,2,3,4,5,6,7,8,9,10 

Method 2 (27 26 bytes)

0FORI=1TO10:?I:NEXT 

Method 3 (4040 39 bytes)

0I=1 1?I,:I=I+1:IFI<11THEN1 

Method 4 (3232 31 bytes)

0?I,:I=I+1:IFI<11THEN0 I=1:GOTO0 

Method 5 (20 bytes)

0?"12345678910 

Method 6 (25 bytes) CBM BASIC V2 only [C64/C64Mini or VIC-20]

0I=I+1:?I:ON-(I<10)GOTO 

I'm working out the memory used with ? 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.

Commodore BASIC, method 1 (28 bytes)

0?1,2,3,4,5,6,7,8,9,10 

Method 2 (27 26 bytes)

0FORI=1TO10:?I:NEXT 

Method 3 (40 bytes)

0I=1 1?I,:I=I+1:IFI<11THEN1 

Method 4 (32 bytes)

0?I,:I=I+1:IFI<11THEN0 I=1:GOTO0 

Method 5 (20 bytes)

0?"12345678910 

Method 6 (25 bytes) CBM BASIC V2 only [C64/C64Mini or VIC-20]

0I=I+1:?I:ON-(I<10)GOTO 

I'm working out the memory used with ? 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.

Commodore BASIC, method 1 (28 bytes)

0?1,2,3,4,5,6,7,8,9,10 

Method 2 (27 26 bytes)

0FORI=1TO10:?I:NEXT 

Method 3 (40 39 bytes)

0I=1 1?I:I=I+1:IFI<11THEN1 

Method 4 (32 31 bytes)

0?I:I=I+1:IFI<11THEN0 I=1:GOTO0 

Method 5 (20 bytes)

0?"12345678910 

Method 6 (25 bytes) CBM BASIC V2 only [C64/C64Mini or VIC-20]

0I=I+1:?I:ON-(I<10)GOTO 

I'm working out the memory used with ? 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.

Some additional methods and byte saving in one of the existing methods
Source Link
Shaun Bebbers
  • 2.4k
  • 18
  • 22

Commodore BASIC, method 1 (28 bytes)#

0 ?1,2,3,4,5,6,7,8,9,10 

Method 2 (2727 26 bytes)

0 FORI=1TO100FORI=1TO10:PRINTI,?I:NEXT 

Method 3 (40 bytes)

0 I=10I=1 1 PRINTI?I,:I=I+1:IFI<11THEN1 

Method 4 (32 bytes)

0 PRINTI?I,:I=I+1:IFI<11THEN0 I=1:GOTO0 

Method 5 (20 bytes)

0?"12345678910 

Method 6 (25 bytes) CBM BASIC V2 only [C64/C64Mini or VIC-20]

0I=I+1:?I:ON-(I<10)GOTO 

I'm working out the memory used with PRINT? 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.

Commodore BASIC, method 1 (28 bytes)#

0 ?1,2,3,4,5,6,7,8,9,10 

Method 2 (27 bytes)

0 FORI=1TO10:PRINTI,:NEXT 

Method 3 (40 bytes)

0 I=1 1 PRINTI,:I=I+1:IFI<11THEN1 

Method 4 (32 bytes)

0 PRINTI,:I=I+1:IFI<11THEN0 I=1:GOTO0 

I'm working out the memory used with PRINT 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.

Commodore BASIC, method 1 (28 bytes)

0?1,2,3,4,5,6,7,8,9,10 

Method 2 (27 26 bytes)

0FORI=1TO10:?I:NEXT 

Method 3 (40 bytes)

0I=1 1?I,:I=I+1:IFI<11THEN1 

Method 4 (32 bytes)

0?I,:I=I+1:IFI<11THEN0 I=1:GOTO0 

Method 5 (20 bytes)

0?"12345678910 

Method 6 (25 bytes) CBM BASIC V2 only [C64/C64Mini or VIC-20]

0I=I+1:?I:ON-(I<10)GOTO 

I'm working out the memory used with ? 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.

Source Link
Shaun Bebbers
  • 2.4k
  • 18
  • 22

Commodore BASIC, method 1 (28 bytes)#

0 ?1,2,3,4,5,6,7,8,9,10 

Method 2 (27 bytes)

0 FORI=1TO10:PRINTI,:NEXT 

Method 3 (40 bytes)

0 I=1 1 PRINTI,:I=I+1:IFI<11THEN1 

Method 4 (32 bytes)

0 PRINTI,:I=I+1:IFI<11THEN0 I=1:GOTO0 

I'm working out the memory used with PRINT 38911-(fre(0)-65536*(fre(0)<0)) on a Commodore 64.