Skip to content

Latest commit

 

History

History

pascals-triangle

Pascal's Triangle

Compute Pascal's triangle up to a given number of rows.

In Pascal's Triangle each number is computed by adding the numbers to the right and left of the current position in the previous row.

    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1
# ... etc

Requirements

Install assignment dependencies:

$ yarn

Making the test suite pass

Execute the tests with:

$ yarn test

Source

Pascal's Triangle at Wolfram Math World http://mathworld.wolfram.com/PascalsTriangle.html