Inliner: BASIC with DEFINEs and without line numbers

Door DamnedAngel

Master (210)

afbeelding van DamnedAngel

29-12-2017, 13:06

Hi all,

just to let you know that Giovanni Nunes has just released Inliner on Github, a nice tool in Python that converts your indented, line-numberless BASIC listing with DEFINEs to a traditional BASIC listing.

Example of usage (as provided by Giovanni):

An original program like this...

'' Kaleidoscope (MSX2 256 colors)

' define WIDTH 255
' define HEIGHT 211
' define MAXCOLORS 256

COLOR 15,0,0

    FOR I%=0 TO {{WIDTH}} STEP 2
        ' pick up a color
        ' left side
        LINE (0,0)-STEP(I%,{{HEIGHT}}),K%
        LINE (0,{{HEIGHT}})-STEP(I%,-{{HEIGHT}}),K%
        ' right side
        LINE ({{WIDTH}},0)-STEP(-I%,{{HEIGHT}}),K%
        LINE ({{WIDTH}},{{HEIGHT}})-STEP(-I%,-{{HEIGHT}}),K%
    NEXT I%
    GOTO {{main_loop}}

... becomes this:

10 ' Kaleidoscope (MSX2 256 colors)
20 COLOR 15,0,0:SCREEN 8:I%=RND(-TIME)
30 FOR I%=0 TO 255 STEP 2:K%=256*RND(1):LINE (0,0)-STEP(I%,211),K%:LI
NE (0,211)-STEP(I%,-211),K%:LINE (255,0)-STEP(-I%,211),K%:LINE (255,2
11)-STEP(-I%,-211),K%:NEXT I%:GOTO 30

Articles (in Portuguese) here and here.


Aangemeld of registreer om reacties te plaatsen

Van Manuel

Ascended (17477)

afbeelding van Manuel

29-12-2017, 13:25

A bit like NestorPreter?

Van PlainSpooky

Resident (53)

afbeelding van PlainSpooky

29-12-2017, 13:47

Yes, but in a more agnostic approach and to be used in any BASIC dialect without many changes on language's syntax.

Van DanySoft

Champion (438)

afbeelding van DanySoft

06-01-2018, 21:18

Mmhh... the double "{{" / "}}" ...
I do not like this!
I prefer to use "NestorPreter" or "tabmegx"!! Smile