Logic & Computation Final Project:
Reversi
Final Project: Build a Reversi AI
Your final project is to build an AI that plays Reversi (also known as Othello). You will be competing
against your classmates in a tournament, so the stronger your AI, the better. This page contains
everything you need to understand the game itself. Strategy and approach are yours to figure out.
What is Reversi?
Reversi is a two-player strategy board game played on an 8x8 grid. Players take turns placing discs
on the board, with one side black and the other white. Each player is assigned a color and the goal
is to have the majority of discs showing your color when the game ends.
Rules of the Game
1. The game begins with four discs placed in the center of the board in a diagonal pattern:
two black and two white, alternating.
2. Black moves first. On your turn, you must place a disc of your color on an empty square such
that it flanks one or more of your opponent's discs.
3. Flanking means your newly placed disc and an existing disc of your color form a straight line
(horizontal, vertical, or diagonal), with one or more of your opponent's discs in between.
All flanked opponent discs are flipped to your color.
4. You can flip discs in multiple directions with a single move.
5. If a player cannot make a valid move, their turn is skipped. If neither player can move,
the game ends.
6. The game also ends when the board is completely filled. The player with the most discs of
their color on the board wins.
Getting Started
You have been provided with a random-move AI that already contains useful methods and information
for you to build on top of. Use what is available to you in that code as your starting point.
Read through it carefully — the methods provided will save you a lot of work.
Your job is to replace the random decision-making with something smarter. How you do that is
entirely up to you. What is permitted, you may ask? As long as it's not cheating, then,
E V E R Y T H I N G I S P E R M I T T E D.
Final Notes
Make sure you fully understand the rules before writing any code. Play a few games by hand or
online to build your intuition for how the game flows. The best AIs are built iteratively — start
with small improvements over the random player and keep refining.
Good luck, and may the best algorithm win.