New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mauler

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mauler

A JavaScript framework for abstract strategy games

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

Mauler

Mauler is a JavaScript framework for abstract strategy games.

Installation

$ npm install mauler

Games

  • Tic-Tac-Toe

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

FAQs

Package last updated on 15 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts