This project contains the base for a fun late night competition amongst friends where each contestant implements an Othello bot. The bots will then face eachother in a tournament eliminating each other until one is left victorious.
- Only implement the abstract methods of Player.
- Don't access private members.
- Honour contracts, follow the documentation.
- An error occuring results in the player causing the error to lose the game.
- Making a move is limited to 5 seconds. Taking longer results in a loss.
Click the fork button in the github interface
Clone your fork using git
$ git clone <url-to-your-fork>
$ cd <your-fork>
Install the dependencies using npm
$ npm install
Example:
// #/src/bot/RandomBot.js
import { Player } from "../game/Player";
export class RandomBot extends Player {
constructor(name, color) {
super(name, color);
}
async getNextMove(state) {
const possibleMoves = state.getPossibleMoves();
const randomMove = possibleMoves[ Math.floor(Math.random() * possibleMoves.length) ];
return { x: randomMove.x, y: randomMove.y };
}
clone() {
return new RandomBot(this.name, this.color);
}
}
Add your implementation to the player list
// #/src/app.js
const players = [
new RandomBot("A", "black"),
new RandomBot("B", "white")
];
Serve the application locally
$ npm start
Visit localhost:8080
in a browser and see them go!
$ git add src/bot/RandomBot.js
$ git commit -m "Add random bot player implementation"
$ git push
A pull request can be made in your forked project UI on github
MIT, see LICENSE file.