summaryrefslogtreecommitdiff
path: root/2019
diff options
context:
space:
mode:
Diffstat (limited to '2019')
-rw-r--r--2019/IntCode.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/2019/IntCode.hs b/2019/IntCode.hs
index 2096bcc..8d180bf 100644
--- a/2019/IntCode.hs
+++ b/2019/IntCode.hs
@@ -172,7 +172,7 @@ runArray arr ptr inp offset = do
resolve (Addr n) = do
(_, right) <- SA.getBounds arr
let n' = fromIntegral n
- if n' >= right then return 0 else SA.readArray arr n'
+ if n' > right then return 0 else SA.readArray arr n'
resolve (Imm n) = return n
resolve (Rel n) = resolve (Addr (fromIntegral offset + n))
resolveAddr (Addr n) = n