Commit 1e1e959c authored by simonmar's avatar simonmar

[project @ 2005-04-28 10:26:30 by simonmar]

mode=slow
parent a8522e82
......@@ -7,6 +7,9 @@ import System -- 1.3
import List -- 1.3
import Char -- 1.3
import System.Environment
import Control.Monad
-- To keep it backward compatible with pre-Haskell 98 compilers..
#if __HASKELL1__ >= 5
#define fail ioError
......@@ -107,13 +110,13 @@ cal year = unlines (banner year `above` body year)
-- For a standalone calendar program:
main = do
strs <- getArgs
case strs of [year] -> calFor year
_ -> fail (userError "Usage: cal year\n")
(year:n:_) <- getArgs
replicateM_ (read n) (calFor year)
calFor year | illFormed = fail (userError "Bad argument")
| otherwise = putStr (cal yr)
| otherwise = print (length (cal yr))
-- SDM: changed to print the length, otherwise
-- stdout file is too huge.
where illFormed = null ds || not (null rs)
(ds,rs) = span isDigit year
yr = atoi ds
......
......@@ -3,8 +3,9 @@ include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -cpp
# Arguments for test program
PROG_ARGS = 1993
FAST_OPTS = 1993 1
NORM_OPTS = 1993 1
SLOW_OPTS = 1993 2000
include $(TOP)/mk/target.mk
This diff is collapsed.
1993
January February March
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 1 2 3 4 5 6 1 2 3 4 5 6
3 4 5 6 7 8 9 7 8 9 10 11 12 13 7 8 9 10 11 12 13
10 11 12 13 14 15 16 14 15 16 17 18 19 20 14 15 16 17 18 19 20
17 18 19 20 21 22 23 21 22 23 24 25 26 27 21 22 23 24 25 26 27
24 25 26 27 28 29 30 28 28 29 30 31
31
April May June
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 1 1 2 3 4 5
4 5 6 7 8 9 10 2 3 4 5 6 7 8 6 7 8 9 10 11 12
11 12 13 14 15 16 17 9 10 11 12 13 14 15 13 14 15 16 17 18 19
18 19 20 21 22 23 24 16 17 18 19 20 21 22 20 21 22 23 24 25 26
25 26 27 28 29 30 23 24 25 26 27 28 29 27 28 29 30
30 31
July August September
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 1 2 3 4 5 6 7 1 2 3 4
4 5 6 7 8 9 10 8 9 10 11 12 13 14 5 6 7 8 9 10 11
11 12 13 14 15 16 17 15 16 17 18 19 20 21 12 13 14 15 16 17 18
18 19 20 21 22 23 24 22 23 24 25 26 27 28 19 20 21 22 23 24 25
25 26 27 28 29 30 31 29 30 31 26 27 28 29 30
October November December
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 1 2 3 4 5 6 1 2 3 4
3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11
10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18
17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25
24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31
31
2888
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment