Flip. Match. Forget. Repeat.
A Java memory card game with multi-player support, persistent high scores, and game replay. Built as OOP coursework โ turned out pretty fun.
Classic memory card game. Cards are face-down. You flip two at a time. If they match, they stay revealed. If not, they flip back โ and youโd better remember where they were. Clear the whole board to win.
Two flavours:
MainDriver.java(row, col) (row, col)The faster and more efficiently you play, the higher your score:
baseScore = (tilesยฒ) - ((moves - perfectFlips)ยฒ) - exposureTime
finalScore = baseScore ร 200,000
src/com/oop/memorygame/
โโโ drivers/
โ โโโ MainDriver.java # Entry point, menus, game loop
โ โโโ Constants.java # Emoji list, screen config, validation rules
โ โโโ BoardThread.java # Board display + player input (threaded)
โ โโโ MoveRecorderThread.java # Records moves in parallel
โ โโโ Replayer.java # Replays saved games
โโโ gameobjects/
โ โโโ Tile.java # Abstract tile (position, state, matched?)
โ โโโ EmojiTile.java # ๐ Emoji variant
โ โโโ LatinTile.java # ๐ค Letter variant
โ โโโ NewGameBoard.java # Randomly generates a fresh board
โ โโโ LoadGameBoard.java # Loads board, validates moves, handles matching
โ โโโ Move.java # One move = two tile coordinates
โ โโโ MoveCollection.java # Full move history for a session
โ โโโ Player.java # Name, password, high score
โ โโโ PlayerGroup.java # Rankings + leaderboard management
โโโ filemodifiers/
โ โโโ Savable.java # Interface: "I can be written to a file"
โ โโโ FileModifier.java # Abstract read/write base
โ โโโ SortedFileModifier.java # Sorted persistence via TreeSet
โโโ userinputs/
โโโ GameParameter.java # Base class for validated inputs
โโโ GameTypeParameter.java # Emoji or Latin?
โโโ DimensionsParameter.java # Valid board dimensions
โโโ FlashTime.java # How long cards stay visible
โโโ InputPlayerName.java # Alphanumeric, max 8 chars
| File | Whatโs in it |
|---|---|
boardfile.txt |
Current board state |
playersfile.txt |
Players, scores, passwords (semicolon-delimited) |
movecollection.txt |
Last gameโs move history |
gamesettings.txt |
Saved game configuration |
Test/
โโโ PlayerTests.java
โโโ GameBoardTest.java
โโโ TileTests.java
โโโ MoveTests.java
โโโ MoveCollectionTests.java
โโโ PlayersGroupTest.java
Covers players, boards, tiles, moves, collections, and group rankings.