aboutsummaryrefslogtreecommitdiff
path: root/challenge-030
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-030')
-rwxr-xr-xchallenge-030/stuart-little/haskell/ch-1.hs9
-rwxr-xr-xchallenge-030/stuart-little/haskell/ch-2.hs8
2 files changed, 17 insertions, 0 deletions
diff --git a/challenge-030/stuart-little/haskell/ch-1.hs b/challenge-030/stuart-little/haskell/ch-1.hs
new file mode 100755
index 0000000000..262938f8ad
--- /dev/null
+++ b/challenge-030/stuart-little/haskell/ch-1.hs
@@ -0,0 +1,9 @@
+#!/usr/bin/env runghc
+
+-- run <script>
+
+import System.Environment (getArgs,)
+import Data.Time.Calendar (dayOfWeek,fromGregorian,DayOfWeek( Sunday ),)
+
+main = do
+ mapM_ print $ filter (\d -> Sunday == (dayOfWeek d)) $ map (\y -> fromGregorian y 12 25) [2019..2100]
diff --git a/challenge-030/stuart-little/haskell/ch-2.hs b/challenge-030/stuart-little/haskell/ch-2.hs
new file mode 100755
index 0000000000..3c7fd77178
--- /dev/null
+++ b/challenge-030/stuart-little/haskell/ch-2.hs
@@ -0,0 +1,8 @@
+#!/usr/bin/env runghc
+
+-- run <script>
+
+import System.Environment (getArgs,)
+
+main = do
+ mapM_ print [(x,y,12-x-y) | x <- [1..10], y <- [1..10], x + y < 12]