Skip to content

davidrobles/mauler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());
}

About

A JavaScript framework for abstract strategy games

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published