Skip to content
A JavaScript framework for abstract strategy games
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib
src
.gitignore
Gruntfile.js
README.md
package.json
sourceFiles.json

README.md

Mauler

Mauler is a JavaScript framework for abstract strategy games.

Installation

$ npm install mauler

Games

Algorithms

Play a Random Game

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

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());
}
You can’t perform that action at this time.