Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tom-weatherhead/thaw-reversi-engine
A Node.js Reversi (Othello) game engine with alpha-beta pruning and a heuristic, packaged for npm.
https://github.com/tom-weatherhead/thaw-reversi-engine
alpha-beta-pruning game-engine heuristic minimax-algorithm othello reversi
Last synced: about 7 hours ago
JSON representation
A Node.js Reversi (Othello) game engine with alpha-beta pruning and a heuristic, packaged for npm.
- Host: GitHub
- URL: https://github.com/tom-weatherhead/thaw-reversi-engine
- Owner: tom-weatherhead
- License: mit
- Created: 2017-08-24T11:55:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:36:53.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T23:05:04.816Z (about 1 month ago)
- Topics: alpha-beta-pruning, game-engine, heuristic, minimax-algorithm, othello, reversi
- Language: JavaScript
- Homepage:
- Size: 1.57 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# thaw-reversi-engine
A Node.js Reversi (Othello) game engine with alpha-beta pruning and a heuristic, packaged for npm.[![Build Status](https://secure.travis-ci.org/tom-weatherhead/thaw-reversi-engine.svg)](https://travis-ci.org/tom-weatherhead/thaw-reversi-engine)
[![npm](https://img.shields.io/npm/v/thaw-reversi-engine.svg)](https://www.npmjs.com/package/thaw-reversi-engine)
[![npm](https://img.shields.io/npm/dt/thaw-reversi-engine.svg)](https://www.npmjs.com/package/thaw-reversi-engine)
[![Maintainability](https://api.codeclimate.com/v1/badges/547c20d9044f10b69c44/maintainability)](https://codeclimate.com/github/tom-weatherhead/thaw-reversi-engine/maintainability)
[![test coverage](https://api.codeclimate.com/v1/badges/547c20d9044f10b69c44/test_coverage)](https://codeclimate.com/github/tom-weatherhead/othello-angular-electron/test_coverage)
[![Known Vulnerabilities](https://snyk.io/test/github/tom-weatherhead/thaw-reversi-engine/badge.svg?targetFile=package.json&package-lock.json)](https://snyk.io/test/github/tom-weatherhead/thaw-reversi-engine?targetFile=package.json&package-lock.json)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/tom-weatherhead/thaw-reversi-engine/blob/master/LICENSE)### Git Installation Instructions
```
git clone https://github.com/tom-weatherhead/thaw-reversi-engine.git
cd thaw-reversi-engine
npm install -g grunt
npm install
grunt
```### npm Installation Instructions
```
npm install [--save] thaw-reversi-engine
```Note: The command "grunt" runs lint and unit tests.
### Sample Usage of the npm Package
```js
let engine = require('thaw-reversi-engine');let boardString = engine.createInitialBoard();
let player = 'X';
let maxPly = 5;try {
let result = engine.findBestMove(boardString, player, maxPly);console.log(result);
} catch (error) {
console.error('engine.findBestMove() threw an exception:', error);
}
```Output: E.g.
```js
{
bestRow: 4,
bestColumn: 2,
bestScore: 3,
bestMoves: [
{ row: 2, column: 4 },
{ row: 3, column: 5 },
{ row: 4, column: 2 },
{ row: 5, column: 3 }
]
}
```## License
MIT