Back to projects
Software Engineering2024Software Project

Othello - Java Board Game

A JavaFX Othello application organized as a maintainable software product, with separated game logic, presentation, tests and automated delivery.

Java 22JavaFXGradleJUnitGitLab CI
Preview of Othello - Java Board Game

Engineering intent

Building the project, not only the feature.

I approached this Othello game as more than a collection of rules and buttons. The objective was to organize a complete desktop application so that each responsibility had a clear place, the behavior could be tested without opening the interface and another developer could build or run the project without depending on my IDE.

The engineering goal

The game needed to support valid-move detection, piece capture, scoring, multiple player modes, undo, save and load while keeping the JavaFX interface independent from the core rules. That separation made new features easier to add and reduced the risk that a visual change would break the game itself.

Project structure

Four responsibilities, four clear boundaries

01

Core domain

Grid, pawn, player, position and game-rule classes describe Othello in plain Java. This layer decides what a valid move is and which pieces must be flipped without knowing anything about JavaFX.

02

Application flow

Gameplay and controllers coordinate turns, scores, game modes and the history of states. Save, load and undo are handled as explicit application features rather than being mixed into button code.

03

Presentation

The graphics package exposes reusable board-game abstractions, while the JavaFX implementation builds the window, board, controls and click handling behind those interfaces.

04

Infrastructure

Configuration, file persistence, the Java module descriptor and Gradle build scripts connect the application to the operating system and its runtime dependencies.

Working principles

Choices that keep change manageable

Depend on clear contracts

Interfaces between the controller and view keep the application logic from depending directly on one concrete screen implementation.

Keep state intentional

Each move creates a game-state snapshot. The same model supports undo, persistence and restoring a previous session.

Test behavior in isolation

A suite of 46 JUnit and Mockito tests covers board rules, players, gameplay and controllers without requiring the JavaFX window to be launched.

Document the entry path

The README explains prerequisites and consistent build, test and run commands for macOS, Linux and Windows.

Professional delivery

Build, verify and package the same way every time

Reproducible build

The Gradle wrapper pins the build workflow so contributors do not need to install a matching Gradle version globally.

Automated verification

GitLab CI builds the project with JDK 22 and preserves the generated JAR as a pipeline artifact.

Desktop distribution

The Java module system and jlink configuration prepare a self-contained runtime image instead of assuming every user has a correctly configured JavaFX environment.

Playable demo

The rules, running in the browser

Browser adaptation

Play the core Othello rules

Place a piece on a highlighted square to surround and flip the opponent's pieces. Choose the original two-player experience or face the project's Minimax AI.

Game mode

Black

2

White

2

Your turn (Black). You play against the AI.

Reflection

What the project demonstrates

The most important result is not only a playable Othello game. It is a codebase with visible boundaries: rules can evolve independently, presentation technology can be replaced, automated checks protect existing behavior and the delivery path is part of the repository. This is the foundation that allows a small application to grow without becoming difficult to maintain.