packages feed

code-conjure-0.3.6: eg/factorial.out

factorial :: Int -> Int
-- testing 6 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 0 candidates of size 2
-- looking through 0 candidates of size 3
-- looking through 2 candidates of size 4
factorial n  =  product (enumFromTo 1 n)

factorial :: Int -> Int
-- testing 6 combinations of argument values
-- looking through 3 candidates of size 1
-- looking through 2 candidates of size 2
-- looking through 5 candidates of size 3
-- looking through 6 candidates of size 4
-- looking through 20 candidates of size 5
-- looking through 27 candidates of size 6
-- looking through 87 candidates of size 7
-- looking through 173 candidates of size 8
-- looking through 434 candidates of size 9
-- looking through 1016 candidates of size 10
factorial n  =  if n == 0 then 1 else n * factorial (dec n)