Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mtripg6666tdr/othello.js

A simple & easy-to-use othello game implementation in pure TypeScript. With no dependency.
https://github.com/mtripg6666tdr/othello.js

javascript npm npm-package othello othello-game typescript

Last synced: about 1 month ago
JSON representation

A simple & easy-to-use othello game implementation in pure TypeScript. With no dependency.

Awesome Lists containing this project

README

        

# othello.js
An easy-to-use othello game implementation in TypeScript.
[Example usage](https://mtripg6666tdr.github.io/othello.js/sample/)
[Documentation](https://mtripg6666tdr.github.io/othello.js/docs/modules.html)

**This project is still under construction**

# Installation
- via CDN
```html

```
- via package manager
```bash
npm i othello.js
```

# Usage
```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();
```
# API
See [documentation](https://mtripg6666tdr.github.io/othello.js/docs/modules.html) to see more available api.

# License
See [LICENSE](LICENSE) for more info.