Programming Challenge Description:
A Pascal's triangle row is constructed by looking at the previous row and adding the numbers to its left and right to arrive at the new value. If either the number to its left/right is not present, substitute a zero in it's place. More details can be found here: Pascal's triangle. E.g. a Pascal's triangle up to a depth of 6 can be shown as:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Input: Your program should read lines from standard input. Each line contains a positive integer which indicates the depth of the triangle (1 based).
Output: Print out the resulting pascal triangle up to the requested depth in row major form.
stack ghci
main