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

Wrong condition #1

Open
BertLisser opened this issue Sep 21, 2018 · 0 comments
Open

Wrong condition #1

BertLisser opened this issue Sep 21, 2018 · 0 comments

Comments

@BertLisser
Copy link

BertLisser commented Sep 21, 2018

Ex. 5

-- we restrict the domain of n to [1,20) so that the result remains computable
-- tests that all elements of lists are derangements of each other
isEveryElementDerangementTest :: Int -> Bool
isEveryElementDerangementTest n = apply' (n <= 1 && n > 10) (-->) (and (map (isDerangement [0..n-1]) (deran n)))

--tests if every element generated by 'deran' is a permutation of original
isEveryElementPermutationTest :: Int -> Bool
isEveryElementPermutationTest n = apply' (n <= 1 && n > 10) (-->) (and (map (isPermutation' [0..n-1]) (deran n)))

must become

-- we restrict the domain of n to [1,20) so that the result remains computable
-- tests that all elements of lists are derangements of each other
isEveryElementDerangementTest :: Int -> Bool
isEveryElementDerangementTest n = apply' (n >=1  && n  <10) (-->) (and (map (isDerangement [0..n-1]) (deran n)))

--tests if every element generated by 'deran' is a permutation of original
isEveryElementPermutationTest :: Int -> Bool
isEveryElementPermutationTest n = apply' (n >= 1 && n  < 10) (-->) (and (map (isPermutation' [0..n-1]) (deran n)))

Ex. 6

--checks if latin alphabet character will be encoded via rot13
rot13EncodedPropertyChar :: Char -> Bool
rot13EncodedPropertyChar x = (x `elem` rot13EncodableAlphabet) --> ((head $ rot13 [x]) /= x)

wrong implementation of the requirement.

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