This is a simple implementation of the Othello (also known as Reversi) game in Java. Othello is a strategy board game for two players, where the goal is to have the majority of discs in your color on the board at the end of the game.
![]() Main menu |
![]() Player selecter |
![]() Othello gameplay |
- Two-player gameplay (Player vs. Player).
- Human vs Human (Human vs. Human).
- Human vs Computer (Player vs. Random or Greedy).
- Computer vs Computer (Either combination of Random and Greedy).
- Board display with javafx.
- Game ending condition (when no valid moves are left for either player).
- Saving Othello games to files.
- Loading Othello games from files using default file manager.
- Undo and redo of moves.
- Restarting games.
- Java 17 or higher.
-
Clone the repository:
git clone https://github.com/TotalDarkness-NRF/Othello.git cd Othello -
Run the Othello Application:
./gradlew run
-
Optional play on terminal: Run any of the OthelloController main functions.
Example: OthelloControllerHumanVSHuman plays to human players on the terminal.
- Player 1 uses the
Xor 'Black' pieces and Player 2 uses theOor 'White' pieces. - Players take turns placing their pieces on the board. The piece is placed on an empty space where it surrounds one or more of the opponent's pieces between the newly placed piece and another of the player's own pieces.
- Once all valid moves are exhausted, the player with the most pieces of their color wins.
- Board Size: The Othello board is an 8x8 grid.
- Valid Moves: A move is valid if it captures at least one of the opponent's pieces by flipping them to your own color.
- Flipping: A piece is flipped if it's surrounded by the players pieces on one or more lines (horizontally, vertically, or diagonally).


