Hacker News new | ask | show | jobs
by wazoox 990 days ago
Back 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 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/...

4 comments

In a roundabout way BASIC on those machines is like modern high-level languages.

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.

That's actually really insightful somehow.
Do you think you'd be able to find that 2 line breakout? I'm currently doing a breakout implementation on my Commodore 64. In assembly though, so definitely more than two lines ;-) Nevertheless, a two line breakout in Basic would probably give lots of pointers on how to make things more compact.
Not the GP but you can find it on the "HEBDOGICIEL, les listings" Website [1]. Deulignes section, page 15 [2] (Casse-briques by Laurent Auble). Published in issue 104, page 12 (second box) [3]:

    1 SPRITEON:IFK=2THENR=-2:B=2*SGN(X-Z-4):RETURNELSEIFK=0THENCOLOR4,0,0:SCREEN2,1:DEFINTA-Z:J=186:X=140:Y=80:VPOKE14336,128:VPOKE14344,248:LINE(80,40)-(183,61),7,BF:LINE(78,7)-(184,J),2,B:LINE(Y,8)-(183,10),1,BF:R=2:B=2:Z=X:ONSPRITEGOSUB1ELSEIFL>5THENRUN
    2 K=2:S=STICK(0):Z=Z+2*(S=3)*(Z<174)-2*(S=7)*(Z>80):PUTSPRITE1,(Z,161):Y=Y+R:X=X+B:PUTSPRITE0,(X,Y),11:P=POINT(X,Y):IFP=0THEN2ELSEIFP=7THENR=-R:A=(X\4)*4:LINE(A,Y)-(A+3,Y+1),0,B:GOTO2ELSEIFP=1THENR=2:GOTO2ELSEIFY>180THENL=L+1:Y=80:K=1:GOTO1ELSEB=-B:GOTO2
Direct link to the source code [4]

[1] http://www.hebdogiciel.free.fr/

[2] http://www.hebdogiciel.free.fr/2lignes_15.htm

[3] https://archive.org/details/hebdogiciel-french-104/page/n11/...

[4] http://www.hebdogiciel.free.fr/hd-roms/2lignes/2lignes_MSX_n...

Great find, thanks!

It didn't seem like any of your links was to a playable version, so I had a Goog' and a paste and came up with [1]. Pretty impressive game for that amount of code, I'd say.

I've never written a line of code on an actual MSX machine (even though I was around in the 80s), it's kind of amazing the amount of emulation Magic Power we casually throw around, these days. Massive thanks to all the emulation authors and (of course) retro computer archivists.

Edit: typo, more compliments.

[1]: https://msxpen.com/codes/-NflxlFRyvOOYbih_5WK

I remember this one well because I had an MSX, and like everyone else back then I didn't have that many games to play with, so I used this code quite extensively :)
Ok, so no Whitespace. I wonder how the parser works that handles RETURNELSEIFK or ONSPRITEGOSUB1ELSEIFL.
The lines of BASIC code are tokenized according to the shortest words.
Well I don't remember in which issue it was, but the whole collection is here:

https://archive.org/details/hebdogiciel-french

I'm pretty sure it's really difficult to convert MSX-BASIC to 6502 assembly though... But there are lots and lots of great C64 deulignes too :)

+1 for mentionning the best (objectively :-) ) computer magazine of all time (in french, that is).

Et les dessins de Carali...

that's a nice amount of code there.