Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Pascal's triangle in 10 lines
--ghc 7.10 main = putStr $ printpas(6,6) pas(x,y) |x==y =1 |y==0 =1 |otherwise =pas(x-1,y-1)+pas(x-1,y) printpas(x,y) |x==0 ="1" |y==0 = show (pas(x,y)) ++ "\n" ++ printpas(x-1,x-1) |otherwise = show (pas(x,y)) ++ " " ++ printpas(x,y-1)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
project euler 2, haskell
Goodstein sequences
My "tying the knot"
equiv
Reader
haskell
Reader
Token
mySqrt
Modular arithmetic with propagating type-checked modulus
Please log in to post a comment.