The Reversi/Othello Game project is a Java-based implementation of the classic Reversi/Othello board game. The project adheres to the Model-View-Controller (MVC) architectural pattern to ensure a well-structured and modular design. It encompasses a graphical user interface (GUI) that enables players to interact with the game board, make moves, and compete against each other or an AI opponent. The program's components include the GUIView
class, which handles the graphical interface, and the ReversiController
class, responsible for controlling game logic. The project also utilises the SimpleModel
class, which manages the game state, including current positions of pieces on the board. The project allows flexibility by supporting various combinations of controllers and views for testing purposes. It employs standard Swing/AWT GUI classes and follows programming best practices, providing players with a functional and engaging game experience.
-
MVC Architecture: The program is organised into Model, View, and Controller components to ensure modularity and facilitate testing. The codebase introduces essential classes such as
GUIView
(derived fromIView
) for a user-friendly graphical interface andReversiController
(extendingIController
) for gameplay control. The MVC structure also allows for versatile game design, with various controller and view classes being able to be substituted for one another. -
Controller and View Class: Developed a
ReversiController
class that extendsIController
for controlling the game. Implemented aGUIView
class that extendsIView
for the graphical user interface. It interacts with the rest of the program throughIView
methods only. -
Utilisation of Standard Swing/AWT: Utilised standard Swing/awt GUI classes for creating the user interface. The provided classes and custom subclasses of Swing classes are employed to design the GUI elements.
-
Piece Colour Handling: The program automatically changes the colour of pieces that are captured during the game, adhering to the game's rules.
-
Win Detection: Implemented win detection functionality to identify the player who wins the game. The winner is determined based on the count of pieces of each colour on the board.
-
Greedy AI Function: Included a simple 'greedy' AI for single-player mode. The AI makes decisions based on maximising its piece count and capturing opponent pieces.
-
Visual Representation: The final program visually resembles the Reversi/Othello game board, starting with an initial configuration of pieces, and updates the board as players make moves. The aesthetics of the interface are also reminiscent of the classic Reversi board game.
