Othello

AI was written for a Computer Science assignment in Algoritms and Datastructures at Stockholm University.
Algorithm is Minimax with α-β pruning and iterative deepening using a heap datastructure.
It searches 7-10 moves ahead for the optimal move.

Instructions:
Click to place tile.
You play ⚪
AI plays  ⚫
Objective is to have the majority of discs with your color facing up at the end of the game.
(If no valid white placement, click anywhere on board to secede turn)

Rules:

  • White makes first move.*
  • The opponents discs is flipped if outflanked by two other players discs. 
  • Valid Disc placement is that it must flip at least one of the opponents discs.
  • If no valid move the turn goes to the opponent.
  • If neither player has valid moves the game is over.
  • If all discs are placed or there is no more valid placements the game is over.

Strategy:
Don't be fooled about how seemingly badly the AI plays in the beginning.
It's playing 10 moves ahead and choosing the move that's optimal later as opposed to good now. The board state in a game of Othello can flip quickly, literally.
Aim to place your discs in the corners! Corners can never be flipped and are therefore very valuable.
The edges are likewise more valuable than the rest of the playing field because they're statistically more difficult to outflank.
Othello is as much about playing your opponents discs as much as your own.
Make sure to not give it easy flips.

Hope you have fun learning the game and hope it's not too frustrating.
I never win against it.
If you manage to win, leave a comment below with your score. I'd love to hear your winning strategy as well.

Thanks for playing

*Official Othello™ rules has it the other way around, black always starts. This was a mistake on my part, but the game is still functionally the same.

Leave a comment

Log in with itch.io to leave a comment.