Skip to content

Instantly share code, notes, and snippets.

@robn
Created June 21, 2015 02:26
Show Gist options
  • Save robn/daf55088ea9277f63e8e to your computer and use it in GitHub Desktop.
Save robn/daf55088ea9277f63e8e to your computer and use it in GitHub Desktop.
TIS-100 secret level solution
@0
@1
MOV 0, ACC
SAV
MOV UP, ACC
JLZ OUT
ADD 10
SUB 30
JLZ DONE
SWP
ADD 1
SWP
JRO -5
DONE:
SWP
OUT:
MOV ACC, DOWN
@2
@3
@4
MOV UP, ACC
MOV ACC, DOWN
MOV ACC, RIGHT
MOV ACC, RIGHT
@5
MOV LEFT, NIL
MOV 0, DOWN
MOV LEFT, ACC
SAV
SUB LEFT
JNZ DONE
JRO -5
DONE:
MOV 1, DOWN
MOV LEFT, ACC
SWP
MOV ACC, DOWN
SWP
MOV 0, DOWN
JRO -9
@6
MOV UP, DOWN
@7
MOV 0, ACC
SAV
MOV UP, ACC
JNZ DONE
SWP
ADD 1
SWP
JRO -5
DONE:
SWP
MOV ACC, DOWN
MOV UP, DOWN
@8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment