othello.js
Version:
An simple easy-to-use othello game implementation with TypeScript.
44 lines (37 loc) • 1.11 kB
Markdown
An easy-to-use othello game implementation in TypeScript.
[](https://mtripg6666tdr.github.io/othello.js/sample/)
[](https://mtripg6666tdr.github.io/othello.js/docs/modules.html)
**This project is still under construction**
- via CDN
```html
<script defer src="https://cdn.jsdelivr.net/npm/othello.js@v0.0.0-rc2/lib/othello.min.js"></script>
```
- via package manager
```bash
npm i othello.js
```
```ts
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();
```
See [documentation](https://mtripg6666tdr.github.io/othello.js/docs/modules.html) to see more available api.
See [LICENSE](LICENSE) for more info.