Advertisement
Guest User

Untitled

a guest
Jun 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. main = return ()
  2.  
  3. paskal list n i =
  4.  if i == n then
  5.   [list]
  6.  else
  7.   paskal (list++[[1]++(calcRow list i 1)]) n (i+1)
  8.  
  9. calcRow list n index =
  10.  if index == n then
  11.   [1]
  12.  else
  13.   [list !! (n-1) !! index + list !! (n-1) !! (index-1)]++(calcRow list n (index+1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement