1.1.1 • Published 4 years ago

solitaire-game-init v1.1.1

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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
<div class="blank-grid">
    <button id="stockBtn"></button>
    <div id="presented-card"></div>
</div>

In script tag you have specify type module

<script type="module" src="app.js"></script>

Installation

npm i solitaire-game-init --save

Usage

Standard French suited deck of 52 cards

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:

Built With

  • Vanilla JS

Author

  • Zhivko Kanev
1.1.1

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago