This project implements the classic Morra Italian Finger Game using Java with a focus on Object-Oriented Programming principles. The game utilizes Strategy and Factory Design Patterns to create a dynamic and customizable gameplay experience.
- Game Strategies: Includes strategies for random, average, and top player moves, offering varied gameplay.
- Robust Input Validation: Ensures that user inputs are correctly validated to prevent errors.
- Player History Tracking: Keeps track of player statistics for an enhanced and more personalized experience.
- Strategy Pattern: Used to define different strategies for the game moves.
- Factory Pattern: Used to create different strategies dynamically based on the game context.
- Java: The core programming language used to implement the game logic.
Follow these steps to run the game on your local machine:
-
Clone the Repository:
git clone https://github.com/skim411/morra-italian-finger-game.git -
Navigate to the Project Directory:
cd morra-italian-finger-game -
Navigate to the Java Source Folder: If you haven't already, navigate to the
src/main/javadirectory where the Java files are located:cd src/main/java -
Compile the Java Files: Make sure you have Java Development Kit (JDK) installed. Compile all the Java files in the
nz/ac/auckland/se281directory:javac nz/ac/auckland/se281/*.java -
Run the Game: After compiling, run the game by using the following command:
java -cp . nz.ac.auckland.se281.Main- Explanation:
-cp .tells Java to use the current directory as the classpath, ensuring it can find the compiled.classfiles insrc/main/java.nz.ac.auckland.se281.Mainspecifies the fully-qualified class name of the main class in your project.
- Explanation: