Colour Memory Game is a simple memory game where players flip over two cards at a time, trying to find matching pairs. The objective is to find all matching pairs of cards. The game can be played either through a graphical user interface (GUI) or a text-based interface.
- Ensure you have Java Development Kit (JDK) installed.
- Ensure you have Gradle installed or use the included Gradle Wrapper.
To build the application, run the following command:
gradle build
To run the game with a graphical user interface, use the following command:
gradle run
To run the game with a text-based user interface, use the following command:
gradle run -PmainClass=se.mindlab.TextGameUI
To create an executable JAR file that includes all dependencies, use the following command:
./gradlew fatJar
The JAR file will be created in the build/libs
directory with the name memorygame-all.jar
.
To run the game from the JAR file, use the following command:
java -jar build/libs/memorygame-all.jar
- At the start of the game, all cards are face down.
- Players take turns flipping two cards at a time by clicking on them (GUI) or entering the coordinates (TextUI).
- If the two flipped cards match, they remain face up.
- If the two flipped cards do not match, they will be turned face down after a short delay.
- The game ends when all pairs have been found.
- The score is based on the number of matched pairs minus the number of failed matches.
Enjoy playing the Colour Memory Game!