Skip to content

Instantly share code, notes, and snippets.

View recursivecurry's full-sized avatar

Jongsoo Lee recursivecurry

View GitHub Profile
@recursivecurry
recursivecurry / ifp__ex_3_3_12.hs
Created February 11, 2014 04:02
introduction to functional programming - ex 3.3.12
module Score where
import Data.List
cow :: [Char] -> [Char] -> Int
cow sol input = length [1 | (x, y) <- zip sol input, x==y]
bull :: [Char] -> [Char] -> Int
bull sol input = length sol - length (sol \\ input)