Skip to content

Instantly share code, notes, and snippets.

@rubyist
Created December 10, 2013 03:06
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 rubyist/7885150 to your computer and use it in GitHub Desktop.
Save rubyist/7885150 to your computer and use it in GitHub Desktop.
(START)
@SCREEN
D=A
@cur
M=D // Sets CUR to SCREEN
(LOOP)
@KBD // read from keyboard, 0=nothing pressed
D=M
@BLACK
D;JNE // key is pressed, use black
// White
@color
M=0
@DRAW
0;JMP
(BLACK)
@color
M=-1
(END)
(DRAW)
@color
D=M
@cur
A=M
M=D
@cur
M=M+1
@cur
D=M
@24576
D=A-D
@START
D;JEQ
@LOOP
0;JMP
(END)
(END)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment