packages feed

code-conjure-0.3.6: eg/setelem.out

elem :: Int -> [Int] -> Bool
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 3 candidates of size 3
-- looking through 8 candidates of size 4
-- looking through 14 candidates of size 5
-- looking through 25 candidates of size 6
-- looking through 60 candidates of size 7
-- looking through 145 candidates of size 8
-- looking through 332 candidates of size 9
-- looking through 747 candidates of size 10
-- looking through 1826 candidates of size 11
-- looking through 4407 candidates of size 12
-- looking through 10888 candidates of size 13
elem x xs  =  not (null xs) && (head xs == x || elem x (tail xs))

set :: [Int] -> Bool
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 3 candidates of size 3
-- looking through 5 candidates of size 4
-- looking through 11 candidates of size 5
-- looking through 26 candidates of size 6
-- looking through 64 candidates of size 7
-- looking through 145 candidates of size 8
-- looking through 310 candidates of size 9
-- looking through 717 candidates of size 10
-- looking through 1734 candidates of size 11
-- looking through 4135 candidates of size 12
-- looking through 9734 candidates of size 13
set xs  =  null xs || not (elem (head xs) (tail xs)) && set (tail xs)