diff options
| author | chirvasitua <stuart-little@users.noreply.github.com> | 2020-12-31 10:55:04 -0500 |
|---|---|---|
| committer | chirvasitua <stuart-little@users.noreply.github.com> | 2020-12-31 10:55:04 -0500 |
| commit | 1c5e3a7ebd869a85c0eb904451c139656d7b47fd (patch) | |
| tree | ed74549619e92f69c4032056cc9e0a1cd48563cc /challenge-001/stuart-little/haskell | |
| parent | b22bd539ab5083cf0a8cbfab18f6107403751851 (diff) | |
| download | perlweeklychallenge-club-1c5e3a7ebd869a85c0eb904451c139656d7b47fd.tar.gz perlweeklychallenge-club-1c5e3a7ebd869a85c0eb904451c139656d7b47fd.tar.bz2 perlweeklychallenge-club-1c5e3a7ebd869a85c0eb904451c139656d7b47fd.zip | |
1st commit on 001_haskell
Diffstat (limited to 'challenge-001/stuart-little/haskell')
| -rwxr-xr-x | challenge-001/stuart-little/haskell/ch-1.hs | 9 | ||||
| -rwxr-xr-x | challenge-001/stuart-little/haskell/ch-2.hs | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/challenge-001/stuart-little/haskell/ch-1.hs b/challenge-001/stuart-little/haskell/ch-1.hs new file mode 100755 index 0000000000..340b1d58fb --- /dev/null +++ b/challenge-001/stuart-little/haskell/ch-1.hs @@ -0,0 +1,9 @@ +#!/usr/bin/env runghc + +-- run as <script> + +s="Perl Weekly Challenge" + +main = do + putStrLn $ "Number of 'e's: " ++ (show $ length $ filter ((==) 'e') s) + putStrLn (let tr 'e' = 'E'; tr c = c in map tr s) diff --git a/challenge-001/stuart-little/haskell/ch-2.hs b/challenge-001/stuart-little/haskell/ch-2.hs new file mode 100755 index 0000000000..6d4dc47dec --- /dev/null +++ b/challenge-001/stuart-little/haskell/ch-2.hs @@ -0,0 +1,6 @@ +#!/usr/bin/env runghc + +-- run as <script> + +main = do + mapM_ putStrLn (take 20 $ map (\(a,b) -> if (b == "") then a else b) (zip (map show [1..]) (zipWith (++) (cycle $ (replicate 2 "") ++ ["fizz"] ) (cycle $ (replicate 4 "") ++ ["buzz"] )))) |
