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.
Semilattice
Reader
Welcome
equiv_strings
Factors of a number, prime numbers
project euler 9, haskell
ex3
Lowest Common Ancestor in a Binary Tree
Is Preorder BST
Anonymous recursion. Why doesnt compile?
Please log in to post a comment.