https://github.com/nikku/skaat
A Skat game loop
https://github.com/nikku/skaat
card-game game-loop skat
Last synced: about 1 year ago
JSON representation
A Skat game loop
- Host: GitHub
- URL: https://github.com/nikku/skaat
- Owner: nikku
- Created: 2021-01-31T00:04:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-17T23:09:42.000Z (over 2 years ago)
- Last Synced: 2025-05-07T14:24:38.303Z (about 1 year ago)
- Topics: card-game, game-loop, skat
- Language: JavaScript
- Homepage:
- Size: 556 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# skaat
[](https://github.com/nikku/skaat/actions/workflows/CI.yml)
A [Skat](https://en.wikipedia.org/wiki/Skat_%28card_game%29) game loop.
Can be embedded to build a [fully featured Skat application](https://nikku.github.io/skaat-app/).
## Installation
```
npm install skaat
```
## Usage
```javascript
import { Game, Clubs } from 'skaat';
const game = new Game();
game.next('start'); // [ 'ask-bid', 2 ]
game.next('pass', 2); // [ 'ask-bid', 0 ]
game.next('bid', 0, 24); // [ 'ask-ack', 1 ]
game.next('pass', 1); // [ 'ask-declare', 0 ]
game.next('declare', 0, { suit: Clubs }); // [ 'ask-card', 1 ]
...
```
The game loop enforces the rules of [Skat](https://en.wikipedia.org/wiki/Skat_%28card_game%29) and asks you for input as needed. You can provide input via human players [or bots](./test/AutomaSpec.js).
## Related
* [skaat-app](https://github.com/nikku/skaat-app)