30 lines
714 B
Markdown
30 lines
714 B
Markdown
# Pascals Triangle
|
|
|
|
Write a program that computes 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.
|
|
|
|
```plain
|
|
1
|
|
1 1
|
|
1 2 1
|
|
1 3 3 1
|
|
1 4 6 4 1
|
|
# ... etc
|
|
```
|
|
|
|
To run the tests simply run the command `go test` in the exercise directory.
|
|
|
|
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
flag:
|
|
|
|
go test -bench .
|
|
|
|
For more detailed info about the Go track see the [help
|
|
page](http://help.exercism.io/getting-started-with-go.html).
|
|
|
|
## Source
|
|
|
|
Pascal's Triangle at Wolfram Math World [view source](http://mathworld.wolfram.com/PascalsTriangle.html)
|