Skip to main content
Added in explanation and also an alternative method of producing the same result.
Source Link
Shaun Bebbers
  • 2.3k
  • 16
  • 22

Commodore BASIC (C64/128, PET, VIC-20, C16/+4, THEC64/Mini, Ultimate64) ~35 tokenised BASIC bytes

0a$="**********":fori=.to9:?a$:next

Very simply, a string is created called a$; this is of 10 asterisks. This is printed to the screen in a for/next loop, which is from zero to nine inclusive. Each string is printed onto a new row on the screen.

A few tokenised BASIC bytes could be saved with:

0fori=.to9:?"**********":next

Though I think this would be less performant (not that performance will matter with such a trivial BASIC listing).

Commodore 64 running the 10 x 10 challenge

Commodore BASIC (C64/128, PET, VIC-20, C16/+4, THEC64/Mini, Ultimate64) ~35 tokenised BASIC bytes

0a$="**********":fori=.to9:?a$:next

Commodore 64 running the 10 x 10 challenge

Commodore BASIC (C64/128, PET, VIC-20, C16/+4, THEC64/Mini, Ultimate64) ~35 tokenised BASIC bytes

0a$="**********":fori=.to9:?a$:next

Very simply, a string is created called a$; this is of 10 asterisks. This is printed to the screen in a for/next loop, which is from zero to nine inclusive. Each string is printed onto a new row on the screen.

A few tokenised BASIC bytes could be saved with:

0fori=.to9:?"**********":next

Though I think this would be less performant (not that performance will matter with such a trivial BASIC listing).

Commodore 64 running the 10 x 10 challenge

Source Link
Shaun Bebbers
  • 2.3k
  • 16
  • 22

Commodore BASIC (C64/128, PET, VIC-20, C16/+4, THEC64/Mini, Ultimate64) ~35 tokenised BASIC bytes

0a$="**********":fori=.to9:?a$:next

Commodore 64 running the 10 x 10 challenge