forked from Unified-Logic-Development-Team/ConsoleGameHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemoryMatchGame.java
More file actions
30 lines (28 loc) · 983 Bytes
/
MemoryMatchGame.java
File metadata and controls
30 lines (28 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.Optional;
/**
* A game that simulates a memory matching challenge.
* Cards (represented by characters or numbers) are arranged in a grid.
* The player flips two cards at a time and tries to find matching pairs.
* <br />
* The game ends when all pairs have been matched.
* The score can be the number of turns that player took.
* <pre>
* Manages board state and the display of revealed vs. hidden tiles.
* </pre>
* @version 2.1
*/
class MemoryMatchGame implements Game {
@Override
public String getName() {
return "Memory Match";
}
@Override
public Optional<Integer> play() {
System.out.println("Welcome, you are now playing Memory Match");
System.out.println("Flip items to match pairs");
System.out.println("If items don't match flip over, go again");
System.out.println("When all items are matched you win");
System.out.println("Have fun!!!");
return Optional.empty();
}
}