Skip to content

Instantly share code, notes, and snippets.

@plainspooky
Last active December 17, 2017 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plainspooky/5f36156a3fc27b455fef343d59d1e77f to your computer and use it in GitHub Desktop.
Save plainspooky/5f36156a3fc27b455fef343d59d1e77f to your computer and use it in GitHub Desktop.
Example of MSX-BASIC program
'' 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}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment