Browse Source

remembered to filter even numbers

master
Thorn Avery 4 years ago
parent
commit
088ff88052
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      spiral.hs

+ 5
- 2
spiral.hs View File

@@ -54,5 +54,8 @@ main = do
(words args) (words args)


aura :: String -> Bool aura :: String -> Bool
aura s = foldr (&&) True
(map (`elem` ['0'..'9']) s)
aura s = if (foldr (&&) True (map (`elem` ['0'..'9']) s))
then ((mod rs 2) == 1)
else False
where
rs = (read s)::Int

Loading…
Cancel
Save