A straightforward Memory Game where you flip tiles to find matching pairs.
• Java-based mind game implemented with Swing.
• An even number of tiles is laid out in a grid. Each color/number/label appears on two tiles.
• Flip two tiles at a time. If they match, they stay revealed; if not, they reset.
• This game is designed to exercise and improve memory.
• Java 8 or higher
• Java Swing: for GUI components
• Java OOP concepts
• ArrayList: to store tile values and shuffle them for random placement
- Compile and run the code:
javac com/example/memorygame/MemoryGame.java java com.example.memorygame.MemoryGame
- A 4×4 grid with 16 tiles appears. Click on two tiles to flip them:
- If they match, they remain turned over.
- If not, they flip back after a short delay.
- Keep matching until all tiles are revealed.
Enjoy testing your memory!