diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-02-07 00:17:17 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-02-07 00:20:29 -0800 |
commit | 74f1512ff113cf35706af57e9d40c78b7d77f49e (patch) | |
tree | 7c7acb23e1a26387117e464ec6ab01126dbc8ae8 /apps/advent2020/3a.mu | |
parent | 6c4c25555c7df0d78ad41c813345f63cae1819de (diff) | |
download | mu-74f1512ff113cf35706af57e9d40c78b7d77f49e.tar.gz |
7690
Convert comments about magic constants into metadata.
Diffstat (limited to 'apps/advent2020/3a.mu')
-rw-r--r-- | apps/advent2020/3a.mu | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/advent2020/3a.mu b/apps/advent2020/3a.mu index 777a7be0..76bda961 100644 --- a/apps/advent2020/3a.mu +++ b/apps/advent2020/3a.mu @@ -26,7 +26,7 @@ fn main -> _/ebx: int { read-line-from-real-keyboard line # if line is empty (not even a newline), quit var done?/eax: boolean <- stream-empty? line - compare done?, 0 # false + compare done?, 0/false break-if-!= # wastefully recompute width on every line # zero error-checking; we assume input lines are all equally long @@ -34,7 +34,7 @@ fn main -> _/ebx: int { # turn each byte into a tree and append it $main:line-loop: { var done?/eax: boolean <- stream-empty? line - compare done?, 0 # false + compare done?, 0/false break-if-!= #? print-int32-decimal 0, num-rows #? print-string 0, " " @@ -43,10 +43,10 @@ fn main -> _/ebx: int { var dest/ebx: (addr int) <- index trees, trees-length var c/eax: byte <- read-byte line # newline comes only at end of line - compare c, 0xa # newline + compare c, 0xa/newline break-if-= # '#' = tree - compare c, 0x23 # '#' + compare c, 0x23/hash { break-if-!= copy-to *dest, 1 |