Using line number 1 instead of 10 seems like an easy 1 byte save.
they're stored as 16 bit little-endian word, so unless it's used for goto/gosub (whose targets are stored in petscii) the line number makes no difference.
Code Golfing in Commodore BASIC
11–20 of 42 posts
Re: Code Golfing in Commodore BASIC
#12"Deulignes" programs could target any platform, but must only take 2 lines of BASIC (most implementations allow only a limited line length, often 255 characters).
Some programs were really impressive; I remember one complete breakout implementation in MSX-BASIC for instance. People actually made whole (small) games in 2 lines of BASIC!
Here's an example page : https://archive.org/details/hebdogiciel-french-098/page/n15/...
Re: Code Golfing in Commodore BASIC
#13https://gkanold.wixsite.com/homeputerium/games-list-2023 Games written in ten lines of vintage BASIC. (Not related to the article but its title.)
(If you're in Vienna, Austria, you can go to the Retro Gaming Museum and see the winning entries on a real computer, in person..)
Re: Code Golfing in Commodore BASIC
#14Re: Code Golfing in Commodore BASIC
#15Back in the 80s when type-in program magazines were common, in France we had the wonderful "Hebdogiciel" with a perpetually running BASIC programming contest called "deulignes" -- which means "twolines". "Deulignes" programs could target any platform, but must only take 2 lines of BASIC (most implementations allow only a limited line length, often 255 characters). Some programs were really impressive; I remember one…
Slow and inefficient for sure, but most of the magic is happening directly at the hardware level (sprites, memory-mapped IO, etc.), so there's a surprisingly large amount of stuff you can do with very acceptable performance.
Re: Code Golfing in Commodore BASIC
#16Back in the 80s when type-in program magazines were common, in France we had the wonderful "Hebdogiciel" with a perpetually running BASIC programming contest called "deulignes" -- which means "twolines". "Deulignes" programs could target any platform, but must only take 2 lines of BASIC (most implementations allow only a limited line length, often 255 characters). Some programs were really impressive; I remember one…
Et les dessins de Carali...
Re: Code Golfing in Commodore BASIC
#17Earlier quoted context omitted.
they're stored as 16 bit little-endian word, so unless it's used for goto/gosub (whose targets are stored in petscii) the line number makes no difference.
Are they stored as 16 bit words before or after parsing the BASIC code?
Re: Code Golfing in Commodore BASIC
#18Earlier quoted context omitted.
Doesn’t BASIC tokenize those abbreviations to the exact same in-memory bytes like the full keywords?
Yes it does but the amount of bytes the author speaks about regards the amount of characters used for storing the program. That's why he uses the : and removes the spaces.
Re: Code Golfing in Commodore BASIC
#19Back in the 80s when type-in program magazines were common, in France we had the wonderful "Hebdogiciel" with a perpetually running BASIC programming contest called "deulignes" -- which means "twolines". "Deulignes" programs could target any platform, but must only take 2 lines of BASIC (most implementations allow only a limited line length, often 255 characters). Some programs were really impressive; I remember one…
Re: Code Golfing in Commodore BASIC
#20I don't know anything about C64 or C64 BASIC, but would it be possible to intentionally write a shorter binary which will break the interpreter and do what we want instead? For example jump directly to a middle of the kernel ROM routine (akin to ROP in the modern days), or use a bad address in the "next line" offset etc.