notAlone :: [Int] -> Int -> [Int]
notAlone nums x = undefined
Write teamWins to determine if a given team wins a given three in a row.
teamWins :: String -> [Char] -> Bool
teamWins row team = undefined
Write allThrees, which gets all of the three in a row segments from a board.
allThrees :: [String] -> [String]
allThrees board = undefined
Write allTeams, which produces a list of all possible teams.
allTeams :: [String]
Combine the previous functions to solve the problem.
(Bonus.) Family
Tree. I use
momList
to be the list of pairs of strings (mother, child).
findParent momList cow
produces [] or a list containing the
name of the parent of the given cow in a list.
parentList momList cow
produces a list containing the mother,
grandmother, etc. of the given cow. The result could be empty if
the cow has no known mother.
isRelated momList cow1 cow2
gives True if the cows are
related at all.
isRelated :: [(String,String)] -> String -> String -> Bool
isRelated familyTree cow1 cow2 = undefined