Case Study

Othello

Terminal-based Othello board game with an AI mode.

Java

01 — Algorithmic Foundations

This university project (2023) is among my very first achievements in Java (Standard Edition). Designed by a small team of 2 people, the goal was to combine mastery of object-oriented syntax with complex algorithmic challenges by developing a fully playable board game in the console.

The main menu, built purely in text (CLI), allows choosing the game mode, illustrating rigorous management of user inputs (Scanner) and game loops.

Illustration du projet
Main game menu executed in the command prompt

02 — Game Mechanics (1 vs 1)

The Rules Problem Implementing the Othello game requires transposing spatial rules into algorithms. The game requires checking, at each move, in all 8 directions (horizontal, vertical, diagonal), whether opposing pieces are “sandwiched” to be flipped.

The Development The board is modeled by a two-dimensional array. When a player enters coordinates (e.g., A2), the program mathematically calculates the validity of the movement and applies the flipping of the pieces.

Illustration du projet
Othello board display with its coordinates

03 — Artificial Intelligence

Once the rules of the local multiplayer mode were mastered, the next challenge was to program a “bot”.

The integrated AI offers several difficulty levels. It analyzes the current board to evaluate the most mathematically advantageous move in the short or medium term, by weighing the number of pieces potentially flipped by each possible movement.

Illustration du projet
Start of a Player vs. Computer match

04 — Game Flow

The more the grid fills up, the more complex the game state becomes, demonstrating the solidity of the implementation.

Point calculation is performed dynamically each turn. At the end of the 64 turns (or upon mutual blocking of the players), the program totals the white and black pieces.

Othello - End of game and score

The end-game screen announces the winner and handles the clean restart of the game loop, thereby concluding the software experience.

Illustration du projet
A heavily filled grid, forcing the algorithm to calculate multiple flipping chains