Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
(Int,Int) -> Bool plot
--import System.Environment (getArgs) getArgs = return ["4.5"] main = main' . read . head =<< getArgs main' x = putplot (x * 6) (scale x smashlogo) smashlogo = disc 5.5 /\ (non (disc 4.5) \/ cross) cross (x, y) = near 0.75 x 1.5 || near 0.5 y (-1.5) disc r (x, y) = x*x + y*y < r*r scale s f (x, y) = f (x / s, y / s) near eps a b = abs (a - b) < eps (f /\ g) x = f x && g x (f \/ g) x = f x || g x non = (not .) putplot n f = mapM_ putStrLn ls where ls = [[pt x y | x <- xs] | y <- ys] xs = [-n, -n + 0.5 .. n] ys = [ n, n - 1.0 .. -n] pt x y = if f (x, y) then '#' else '.'
run
|
edit
|
history
|
help
0
project euler 8, haskell
mapper
Monoid and friends
boolean functions of zero arguments in haskell
Fibonacci proof
Invert a monotonic function
Haskell Tree example
Factorial in haskell
Pascal's triangle in 10 lines
(⁄⁄>⁄▽⁄<⁄⁄)