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
Setup
Go through the setup instructions for Javascript to install the necessary dependencies:
https://exercism.io/tracks/javascript/installation
Requirements
Please cd
into exercise directory before running all below commands.
Install assignment dependencies:
$ npm install
Making the test suite pass
Execute the tests with:
$ npm test
In the test suites all tests but the first have been skipped.
Once you get a test passing, you can enable the next one by changing xtest
to
test
.
Submitting Solutions
Once you have a solution ready, you can submit it using:
exercism submit pascals-triangle.js
Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
Exercise Source Credits
Pascal's Triangle at Wolfram Math World http://mathworld.wolfram.com/PascalsTriangle.html