.. | ||
pascal_printer | ||
pascal_printer.go | ||
pascal.go | ||
pascals_triangle_test.go | ||
README.md |
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.
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.
Source
Pascal's Triangle at Wolfram Math World view source