Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mtripg6666tdr/othello.js
- Owner: mtripg6666tdr
- License: mit
- Created: 2021-10-29T15:34:02.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-13T12:56:51.000Z (about 2 years ago)
- Last Synced: 2024-09-29T15:21:51.064Z (about 2 months ago)
- Topics: javascript, npm, npm-package, othello, othello-game, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/othello.js
- Size: 204 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.