# solitaire-game-init

> new solitaire game initialization

Latest version **1.1.1** (published 2020-01-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install solitaire-game-init
pnpm add solitaire-game-init
yarn add solitaire-game-init
bun add solitaire-game-init
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-01-10 |
| First published | 2019-09-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zhivko Kanev |
| Maintainers | jivko |
| Keywords | solitaire, playing cards, card game |

## Links

- npm: https://www.npmjs.com/package/solitaire-game-init
- Repository: https://jivkotest@github.com/jivkotest/solitaireGameInit
- Homepage: https://github.com/jivkotest/solitaireGameInit#readme
- Issues: https://github.com/jivkotest/solitaireGameInit/issues
- npm.io page: https://npm.io/package/solitaire-game-init

## Recent versions

- 1.1.1 (latest) — 2020-01-10
- 1.1.0 — 2019-10-21
- 1.0.0 — 2019-09-30
- 0.0.4 — 2019-09-14
- 0.0.3 — 2019-09-14
- 0.0.2 — 2019-09-12
- 0.0.1 — 2019-09-12

## README

# Basic functionality for solitaire games

This package provides a grid of card placeholders with customizable   
number of rows and columns.   
Other customizable options are card suits, values and the number of   
shuffled cards in the stock
(a pile of cards, face down, which are left over   
after setting up the rest of the game).
Once the grid is filled in, an array of the placed cards values is logged in the console.

In your markup you have to provide a button which will pull a new card from the stock   
to be placed on the choosen card placeholder.

## Getting Started

### Prerequisites

* In index.html file you should have the following HTML markup

```html
<div class="blank-grid">
    <button id="stockBtn"></button>
    <div id="presented-card"></div>
</div>
```

In script tag you have specify type *module*

```html
<script type="module" src="app.js"></script>
```

## Installation

`npm i solitaire-game-init --save`

## Usage

Standard French suited deck of 52 cards

```js
import solitaireGameInit from "../node_modules/solitaire-game-init/app.js";

 solitaireGameInit ({
    suits: ["spades", "clubs", "diamonds", "hearts"],
    values: ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"],
    rowsCount: 4,
    colsCount: 13,
    stockCount: 52
})

```

## Options

This package supports following required options:

* *suits* - _["spades", "clubs", "diamonds", "hearts"]_ - array of card suits
* *values* - _["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"]_ - array of card values
* *rowsCount* - _number_ - count of rows in the grid
* *colsCount* - _number_ - count of columns in the grid
* *stockCount* - _number_ - count of cards in the stock. New cards will be presented until the stock is finished, thus (stockCount = rowsCount * colsCount)

## Built With

* Vanilla JS

## Author

* **Zhivko Kanev**

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