# pascals-triangle

> Get a triangular array of the binomial coefficients

Latest version **0.1.1** (published 2016-05-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install pascals-triangle
pnpm add pascals-triangle
yarn add pascals-triangle
bun add pascals-triangle
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-05-14 |
| First published | 2015-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alejandro Beltrán |
| Maintainers | alebelcor |
| Keywords | pascal, triangle, math |

## Links

- npm: https://www.npmjs.com/package/pascals-triangle
- Repository: https://github.com/alebelcor/pascals-triangle
- Homepage: https://github.com/alebelcor/pascals-triangle#readme
- Issues: https://github.com/alebelcor/pascals-triangle/issues
- npm.io page: https://npm.io/package/pascals-triangle

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-05-14
- 0.1.0 — 2015-10-03

## README

# pascal's triangle

> Get a triangular array of the binomial coefficients given a certain number of rows.

[![npm version](https://img.shields.io/npm/v/pascals-triangle.svg)](https://npmjs.org/package/pascals-triangle)
[![Build status](https://img.shields.io/travis/alebelcor/pascals-triangle.svg)](https://travis-ci.org/alebelcor/pascals-triangle)
[![Test coverage](https://img.shields.io/coveralls/alebelcor/pascals-triangle.svg)](https://coveralls.io/github/alebelcor/pascals-triangle)

## Install

```bash
npm install --save pascals-triangle
```

## Usage

```js
var triangle = require('pascals-triangle');

triangle(0); // [ [ 1 ] ]
triangle(1); // [ [ 1 ], [ 1, 1 ] ]
triangle(2); // [ [ 1 ], [ 1, 1 ], [ 1, 2, 1 ] ]
```

## API

### triangle(rows)

Returns a matrix (`array` of `array`s) containing the values of the rows in order from top to bottom.

#### rows

Type: `number`

The number of rows or iterations to produce. It's a zero-based index, so if you want the first level you'd pass in `0`.

## License

MIT © Alejandro Beltrán

---
_Source: https://npm.io/package/pascals-triangle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
