0.0.0-rc3 • Published 2 years ago
othello.js v0.0.0-rc3
othello.js
An easy-to-use othello game implementation in TypeScript.
Example usage
Documentation
This project is still under construction
Installation
- via CDN
<script defer src="https://cdn.jsdelivr.net/npm/othello.js@v0.0.0-rc2/lib/othello.min.js"></script>
- via package manager
npm i othello.js
Usage
import { Game } from "othello.js";
const game = new Game({});
game.addListener("black", () => console.log("Black's turn"));
game.addListener("white", () => console.log("White's turn"));
game.addListener("finish", (result) => console.log("Finish! Wiiner is " + result.winner));
game.put({
current: "white",
type: "put",
x: 2, y: 3
});
game.put({
current: "black",
type: "put",
x: 4, y: 2
});
game.logBoard();
API
See documentation to see more available api.
License
See LICENSE for more info.