diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-01-12 12:58:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-12 12:58:17 +0000 |
| commit | b00c8c4f9ff06c18683a5e5380b03585f3301e43 (patch) | |
| tree | d1580683ab854d976ff43bbc3671bca119a5fc27 | |
| parent | b90eca11870b2e9c28d7a9781f947121ada5a9fe (diff) | |
| parent | d4bc6bb3f500d037ad5189ecd88b077976b14f32 (diff) | |
| download | perlweeklychallenge-club-b00c8c4f9ff06c18683a5e5380b03585f3301e43.tar.gz perlweeklychallenge-club-b00c8c4f9ff06c18683a5e5380b03585f3301e43.tar.bz2 perlweeklychallenge-club-b00c8c4f9ff06c18683a5e5380b03585f3301e43.zip | |
Merge pull request #3230 from stuart-little/stuart-little_026_haskell
1st commit on 026_haskell
| -rwxr-xr-x | challenge-026/stuart-little/haskell/ch-1.hs | 9 | ||||
| -rwxr-xr-x | challenge-026/stuart-little/haskell/ch-2.hs | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/challenge-026/stuart-little/haskell/ch-1.hs b/challenge-026/stuart-little/haskell/ch-1.hs new file mode 100755 index 0000000000..8c603cdb21 --- /dev/null +++ b/challenge-026/stuart-little/haskell/ch-1.hs @@ -0,0 +1,9 @@ +#!/usr/bin/env runghc + +-- run <script> <stones_string> <jewels_string> + +import System.Environment (getArgs,) + +main = do + (stones:jewels:_) <- getArgs + print $ length $ filter (flip elem stones) jewels diff --git a/challenge-026/stuart-little/haskell/ch-2.hs b/challenge-026/stuart-little/haskell/ch-2.hs new file mode 100755 index 0000000000..1f14fe583c --- /dev/null +++ b/challenge-026/stuart-little/haskell/ch-2.hs @@ -0,0 +1,11 @@ +#!/usr/bin/env runghc + +-- run <script> <space-separated angles in degrees> + +import System.Environment (getArgs,) +import Data.Angle +import Data.Tuple.Extra ((&&&),) + +main = do + args <- getArgs + print $ degrees $ Radians (uncurry atan2 $ ((sum.(map sine)) &&& (sum.(map cosine))) $ map (\x -> Degrees (read x::Float)) args) |
