Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- doubleMe x = x + x
- doubleUs x y = x*2 + y*2
- doubleSmallNumber x = if x > 100
- then x
- else x*2
- happySad xs = [ if x < 10 then ":)" else ":(" | x <- xs, odd x]
- -- Sees what the difference from a to b is recursively, but only if
- -- a is bigger.
- -- That difference is appended onto a value input c.
- -- Example stepsFromBWithC 50 25 2
- -- Output would be 27, because it takes 25 steps to get to b, which
- -- would be appended onto c's original value of 2.
- stepsFromBWithC a b c = if a < b then
- c
- else
- let (whoa) = stepsFromBWithC (a-1) b c+1
- in whoa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement