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 SCREEN 8 I%=RND(-TIME) main_loop: FOR I%=0 TO {{WIDTH}} STEP 2 ' pick up a color K%={{MAXCOLORS}}*RND(1) ' 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.
[]s
Login or register to post comments