# mauler

> A JavaScript framework for abstract strategy games

Latest version **0.0.4** (published 2014-12-15) · 0 weekly downloads

## Install

```sh
npm install mauler
pnpm add mauler
yarn add mauler
bun add mauler
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-12-15 |
| First published | 2014-07-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Robles |
| Maintainers | davidrobles |

## Links

- npm: https://www.npmjs.com/package/mauler
- Repository: https://github.com/davidrobles/mauler
- Issues: https://github.com/davidrobles/mauler/issues
- npm.io page: https://npm.io/package/mauler

## Recent versions

- 0.0.4 (latest) — 2014-12-15
- 0.0.3 — 2014-12-14
- 0.0.2 — 2014-12-14
- 0.0.1 — 2014-07-13

## README

Mauler
======

Mauler is a JavaScript framework for abstract strategy games.

Installation
------------

```bash
$ npm install mauler
```

Games
-----

- [Tic-Tac-Toe](http://github.com/davidrobles/mauler/blob/master/src/games/tic-tac-toe/tic-tac-toe.js)

Algorithms
----------

- [Random](http://github.com/davidrobles/mauler/blob/master/src/players/random.js)
- [Minimax](http://github.com/davidrobles/mauler/blob/master/src/players/minimax.js)
- [Negamax](http://github.com/davidrobles/mauler/blob/master/src/players/negamax.js)
- [Alpha-beta pruning](http://github.com/davidrobles/mauler/blob/master/src/players/alpha-beta.js)
- [Monte Carlo](http://github.com/davidrobles/mauler/blob/master/src/players/monte-carlo.js)
- [Monte Carlo Tree Search](http://github.com/davidrobles/mauler/blob/master/src/players/mcts.js)

Play a Random Game
------------------

```js
var game = new ma.games.TicTacToe();
console.log(game.toString());
while (!game.isGameOver() {
  var moves = game.moves();
  var randomMove = moves[Math.floor(Math.random() * moves.length)];
  game.move(randomMove);
  console.log(game.toString());
}
```

Play a Game Between Two Players
-------------------------------

```js
var game = new ma.games.TicTacToe();
var players = [new ma.players.random(), new ma.players.alphaBeta()]
console.log(game.toString());
while (!game.isGameOver() {
  var player = players[game.currentPlayer()];
  var move = player(game);
  game.move(randomMove);
  console.log(game.toString());
}
```

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