TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Code Golfing in Commodore BASIC

54 pointsby Two9Aover 1 year ago

8 comments

wazooxover 1 year ago
Back in the 80s when type-in program magazines were common, in France we had the wonderful &quot;Hebdogiciel&quot; with a perpetually running BASIC programming contest called &quot;deulignes&quot; -- which means &quot;twolines&quot;.<p>&quot;Deulignes&quot; programs could target any platform, but must only take 2 lines of BASIC (most implementations allow only a limited line length, often 255 characters).<p>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!<p>Here&#x27;s an example page : <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;hebdogiciel-french-098&#x2F;page&#x2F;n15&#x2F;mode&#x2F;2up" rel="nofollow noreferrer">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;hebdogiciel-french-098&#x2F;page&#x2F;n15&#x2F;...</a>
评论 #37736487 未加载
评论 #37736622 未加载
评论 #37736508 未加载
评论 #37736956 未加载
bump-ladelover 1 year ago
If you enjoy this, then you should definitely checkout 8-Bit Show And Tell’s YouTube channel. The presenter, Robin, regularly does deep dives into code optimisation and fixes on Commodore 64 and other machines.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jhQgHW2VI0o">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jhQgHW2VI0o</a>
qiqitoriover 1 year ago
<a href="https:&#x2F;&#x2F;gkanold.wixsite.com&#x2F;homeputerium&#x2F;games-list-2023" rel="nofollow noreferrer">https:&#x2F;&#x2F;gkanold.wixsite.com&#x2F;homeputerium&#x2F;games-list-2023</a> Games written in ten lines of vintage BASIC. (Not related to the article but its title.)
评论 #37736385 未加载
afro88over 1 year ago
BASIC defaults to the tape device if you leave off the device number in LOAD&#x2F;SAVE commands. So you can save another byte or two by saving to tape instead.
dep_bover 1 year ago
In a C64 BASIC program keywords like SAVE and PRINT can be abbreviated:<p><a href="https:&#x2F;&#x2F;www.c64-wiki.com&#x2F;wiki&#x2F;BASIC_keyword_abbreviation" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.c64-wiki.com&#x2F;wiki&#x2F;BASIC_keyword_abbreviation</a><p>That would shave off some more precious bytes!
评论 #37741600 未加载
评论 #37735258 未加载
lifthrasiirover 1 year ago
I don&#x27;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 &quot;next line&quot; offset etc.
评论 #37736652 未加载
einrover 1 year ago
Using line number 1 instead of 10 seems like an easy 1 byte save.
评论 #37735599 未加载
p0w3n3dover 1 year ago
remember when people didn&#x27;t have FDDs but cassete drives instead, because FDDs were too expensive? Pepperidge Farm remembers
评论 #37737092 未加载