diff --git a/exercises/Set1.hs b/exercises/Set1.hs index 00a9c80..81d2fb4 100644 --- a/exercises/Set1.hs +++ b/exercises/Set1.hs @@ -47,6 +47,10 @@ quadruple x = todo -- -- PS. if you can't remember how the distance is computed, the formula is: -- square root of ((x distance) squared + (y distance) squared) +-- +-- Examples: +-- distance 0 0 1 1 ==> 1.4142135... +-- distance 1 1 4 5 ==> 5.0 distance = todo diff --git a/exercises/Set1Test.hs b/exercises/Set1Test.hs index 30c09e1..9370bfd 100644 --- a/exercises/Set1Test.hs +++ b/exercises/Set1Test.hs @@ -55,7 +55,7 @@ ex4_distance = do y1 <- elements [-5..5] let x2 = x1+deltax let y2 = y1+deltay - return $ $(testing [|distance x1 x2 y1 y2|]) (dist=~?) + return $ $(testing [|distance x1 y1 x2 y2|]) (dist=~?) ex5_eeny_even = forAll_ $ \x -> $(testing [|eeny (2*x)|]) (?=="eeny") ex5_meeny_odd = forAll_ $ \x -> $(testing [|eeny (2*x+1)|]) (?=="meeny")