projects
/
advent-of-code-24.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f5f185
)
Formatting typo fix
author
Neil Smith
<NeilNjae@users.noreply.github.com>
Mon, 2 Dec 2024 10:11:34 +0000
(10:11 +0000)
committer
Neil Smith
<NeilNjae@users.noreply.github.com>
Mon, 2 Dec 2024 10:11:34 +0000
(10:11 +0000)
advent02/Main.hs
patch
|
blob
|
history
diff --git
a/advent02/Main.hs
b/advent02/Main.hs
index a0f453417676a2e9aedff6c04a447cb92c5ec987..6f3af879a9de44268f95d04d3bf4994e873e70fe 100644
(file)
--- a/
advent02/Main.hs
+++ b/
advent02/Main.hs
@@
-21,9
+21,9
@@
isSafe xs = allSameSign diffs && bigEnough diffs && smallEnough diffs
where diffs = zipWith (-) xs (tail xs)
allSameSign xs
- | all (>0) xs = True
- | all (<0) xs = True
- | otherwise = False
+
| all (>0) xs = True
+
| all (<0) xs = True
+
| otherwise = False
bigEnough = all ((>= 1) . abs)
smallEnough = all ((<= 3) . abs)