repl.it
@anonymous/

DrearySelfishArea

Haskell

No description

fork
loading
Files
  • main.hs
main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Data.Char (ord)

wordsToMarks :: String -> Int
wordsToMarks = sum . map ((flip (-) 96) . ord)

main :: IO ()
main = do
    print $ wordsToMarks "love"
    print $ wordsToMarks "friendship"
    print $ wordsToMarks "attitude"
    print $ wordsToMarks "friends"
    print $ wordsToMarks "family"
    print $ wordsToMarks "selflessness"
    print $ wordsToMarks "knowledge"
GHCi, version 8.6.5