-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf49b8f
commit 4643243
Showing
13 changed files
with
928 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,6 @@ | |
|
||
|0000 | ||
|
||
%T< { STKCHK P< } | ||
%>T { >P LF } | ||
|
||
|0100 @program | ||
|
||
T< "parse-line: >T | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,6 @@ | |
|
||
|0000 | ||
|
||
%T< { STKCHK P< } | ||
%>T { >P LF } | ||
|
||
|0100 @program | ||
|
||
T< "parse-dot-line: >T | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
~library/macros.tal | ||
~library/devices.tal | ||
|
||
( variables ) | ||
|
||
|0000 | ||
|
||
( init ) | ||
|
||
|0100 @program | ||
;on-arg-char .Console/vector DEO2 | ||
BRK ! | ||
|
||
@on-arg-char | ||
.Console/read DEI ( char ) | ||
DUP #0a EQU ,&complete JCN | ||
;argv #00 ,&argptr LDR ADD2 STA | ||
,&argptr LDR INC ,&argptr STR | ||
BRK ! | ||
|
||
&complete | ||
POP | ||
|
||
;arg-received JMP2 | ||
|
||
&argptr $1 | ||
|
||
@argv $20 | ||
|
||
( arg is in @argv ) | ||
@arg-received | ||
LIT ': EMIT | ||
;argv ;print JSR2 | ||
LF | ||
|
||
;open-file JSR2 | ||
|
||
;read-byte ;parse-input JSR2 | ||
|
||
;elt-counts/init JSR2 | ||
;pair-counts/init JSR2 | ||
|
||
#0001 #0029 DO | ||
DUP2 DBGSHORTDECn LIT ': EMIT | ||
;apply-rules JSR2 | ||
;elt-counts/print-result JSR2 LF | ||
LOOP | ||
|
||
BRK | ||
|
||
[ ] | ||
|
||
@open-file | ||
;argv .File/name DEO2 | ||
#0001 .File/length DEO2 | ||
RTN | ||
|
||
( -- next-byte ) | ||
@read-byte | ||
#00 ;&byte STA ( clear byte so that EOF reads as zero ) | ||
;&byte .File/read DEO2 | ||
LIT &byte 00 ( <- this byte is patched by the two previous instructions! ) | ||
RTN | ||
|
||
~day14_lib.tal |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
CVKKFSSNNHNPSPPKBHPB | ||
|
||
OF -> S | ||
VO -> F | ||
BP -> S | ||
FC -> S | ||
PN -> K | ||
HC -> P | ||
PP -> N | ||
FK -> V | ||
KN -> C | ||
BO -> O | ||
KS -> B | ||
FF -> S | ||
KC -> B | ||
FV -> C | ||
VF -> N | ||
HS -> H | ||
OS -> F | ||
VC -> S | ||
VP -> P | ||
BC -> O | ||
HF -> F | ||
HO -> F | ||
PC -> B | ||
CC -> K | ||
NB -> N | ||
KK -> N | ||
KP -> V | ||
BH -> H | ||
BF -> O | ||
OB -> F | ||
VK -> P | ||
FB -> O | ||
NP -> B | ||
CB -> C | ||
PS -> S | ||
KO -> V | ||
SP -> C | ||
BK -> O | ||
NN -> O | ||
OC -> F | ||
VB -> B | ||
ON -> K | ||
NK -> B | ||
CK -> H | ||
NH -> N | ||
CV -> C | ||
PF -> P | ||
PV -> V | ||
CP -> N | ||
FP -> N | ||
SB -> B | ||
SN -> N | ||
KF -> F | ||
HP -> S | ||
BN -> V | ||
NF -> B | ||
PO -> O | ||
CH -> O | ||
VV -> S | ||
OV -> V | ||
SF -> P | ||
BV -> S | ||
FH -> V | ||
CN -> H | ||
VH -> V | ||
HB -> B | ||
FN -> P | ||
OH -> S | ||
SK -> H | ||
OP -> H | ||
VN -> V | ||
HN -> P | ||
BS -> S | ||
CF -> B | ||
PB -> H | ||
SS -> K | ||
NV -> P | ||
FS -> N | ||
CS -> O | ||
OK -> B | ||
CO -> O | ||
VS -> F | ||
OO -> B | ||
NO -> H | ||
SO -> F | ||
HH -> K | ||
FO -> H | ||
SH -> O | ||
HV -> B | ||
SV -> N | ||
PH -> F | ||
BB -> P | ||
KV -> B | ||
KB -> H | ||
KH -> N | ||
NC -> P | ||
SC -> S | ||
PK -> B | ||
NS -> V | ||
HK -> B |
Oops, something went wrong.