This is a simple starter kit to build your own othello bot and test it against various players (including yourself!) and AI's.
- Clone this repository
git clone https://github.com/jotdl/my-othello-bot
- Cd into this repository
cd my-othello-bot
- Run
go run main.go
To get your bot started you first need to know what is a valid turn and what is not. Therefore:
- Implement the
findValidTurnsmethod inmain.go. Rungo test .to simply check if your bot returns the valid moves for the initial board (seevalidMoves_test.gofor further details). Iterate until you feel safe that you calculate all possible turns. Feel free to add more testcases tovalidMoves_test.go. - Once you feel safe and want to test your logic against something more advanced, replace
mybot := othello.NewBraindeadAIPlayer()withmybot := othello.FuncPlayer(calculateNextTurn). When you now rungo run .you successfully play against a bot which always takes the first move you return fromfindValidTurns
Implement the ultimate othello bot which will win against all other bots. Therefore extend calculateNextTurn in main.go with logic you think fits best. To test your bot simply run go run ..
You can also adjust the bot you are playing against by changing the assignment of the enemy.
The following enemy bots/players are currently available:
- TerminalPlayer: A bot which reads every turn from stdin so you can play against your bot.
- BraindeadAIPlayer: A bot which just does a random valid move.
- NewSimpleAIPlayer: Always takes the turn which leads to his highest current score.
- AdvancedAIPlayer: A little bit more strategic bot which will try to outplay you.
- MinMaxAIPlayer: A bot which follows the MinMax algorithm (See https://en.wikipedia.org/wiki/Minimax for further details)