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/2a.mu | |
parent | 6c4c25555c7df0d78ad41c813345f63cae1819de (diff) | |
download | mu-74f1512ff113cf35706af57e9d40c78b7d77f49e.tar.gz |
7690
Convert comments about magic constants into metadata.
Diffstat (limited to 'apps/advent2020/2a.mu')
-rw-r--r-- | apps/advent2020/2a.mu | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/advent2020/2a.mu b/apps/advent2020/2a.mu index aad94be4..dc67b94a 100644 --- a/apps/advent2020/2a.mu +++ b/apps/advent2020/2a.mu @@ -20,7 +20,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-!= print-stream-to-real-screen line # slice = next-token(line, '-') @@ -47,7 +47,7 @@ fn main -> _/ebx: int { skip-chars-matching-whitespace line # now check the rest of the line var is-valid?/eax: boolean <- is-valid? start, end, letter, line - compare is-valid?, 0 # false + compare is-valid?, 0/false { break-if-= print-string 0, "valid!\n" @@ -67,7 +67,7 @@ fn is-valid? start: int, end: int, letter: byte, password: (addr stream byte) -> # ++letter-count { var done?/eax: boolean <- stream-empty? password - compare done?, 0 # false + compare done?, 0/false break-if-!= var c/eax: byte <- read-byte password compare c, letter @@ -81,12 +81,12 @@ fn is-valid? start: int, end: int, letter: byte, password: (addr stream byte) -> compare letter-count, start { break-if->= - return 0 # false + return 0/false } compare letter-count, end { break-if-<= - return 0 # false + return 0/false } - return 1 # true + return 1/true } |