Created
January 26, 2016 04:02
-
-
Save Ivoah/ab6b9b29584ac4f01f1e to your computer and use it in GitHub Desktop.
AoC Day 1.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@0 | |
@1 | |
TOP:MOV UP, ACC | |
SUB 40 | |
JLZ DONE | |
MOV ACC, DOWN | |
JMP TOP | |
DONE: | |
JRO 0 | |
@2 | |
##AOC DAY 1.2 | |
MOV 0, ACC | |
ADD DOWN | |
JRO DOWN | |
MOV ACC, DOWN | |
@3 | |
@4 | |
@5 | |
MOV UP, RIGHT | |
@6 | |
MOV 0, ACC | |
SAV | |
LOOP:MOV LEFT, ACC | |
JEZ OPEN | |
MOV -1, RIGHT | |
JMP _ | |
OPEN:MOV 1, RIGHT | |
_:SWP | |
ADD, RIGHT | |
SAV | |
JLZ B | |
MOV RIGHT, NIL | |
JMP LOOP | |
B:MOV RIGHT, DOWN | |
@7 | |
MOV LEFT, ACC | |
SWP | |
ADD 1 | |
SWP | |
MOV ACC, LEFT | |
SWP | |
MOV ACC, LEFT | |
SWP | |
@8 | |
@9 | |
@10 | |
MOV UP, DOWN | |
@11 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment