Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab1: Exercise 8 #1

Open
BertLisser opened this issue Sep 14, 2017 · 0 comments
Open

Lab1: Exercise 8 #1

BertLisser opened this issue Sep 14, 2017 · 0 comments

Comments

@BertLisser
Copy link

notGuilty :: [Boy]
notGuilty = [x | x <- boys, length ( accusers x) /= 3]

Shorter

notGuilty :: [Boy]
notGuilty =  boys \\ guilty

A good remark!

-- A boy made a honest statement if he accused the guilty boys and didn't acused the non-guilty boys
honest :: [Boy]
honest = nub [x | x <- boys, y <- guilty, z <- notGuilty, accuses x y && not (accuses x z)]

Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant