-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFortuneWheelRunner.java
91 lines (89 loc) · 3.24 KB
/
FortuneWheelRunner.java
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Class - AP Computer Science A
// Date - 10/12/2022
// Name - Cody Washington
//Packages
import java.lang.*;
import java.util.Scanner;
//Main Runner Class
public class FortuneWheelRunner
{
public static void main(String[] args)
{
//Credit
System.out.println("[Cody Washington | 10/12/2022 | Wheel of Fortune]");
//Spacing
for(int i = 0; i <= 4; i++)
{
System.out.println();
}
//Setup
Scanner input = new Scanner(System.in);
//Input the Phrase
System.out.print("Your Phrase :: ");
String phrase = input.nextLine();
//Clear Console
System.out.print("\033[H\033[2J");
//Create a new game
FortuneWheel game = new FortuneWheel(phrase.toLowerCase());
//Gameplay Main-Loop
while(game.getGameStatus() == false)
{
//Prinout Information
game.graphics();
//Input Guess Forward to Guess Method
System.out.print("Enter a Guess :: ");
String response = input.nextLine();
//Print a message
switch (game.Guess(response))
{
case 0:
System.out.println("[You've already guessed that.]");
break;
case 1:
System.out.println("[Your guess was in the Phrase.]");
break;
case 2:
System.out.println("[Your guess wasn't in the Phrase.]");
break;
case 3:
System.out.println("[Your guess wasn't the Phrase.]");
break;
case 4:
System.out.println("[Your guess was the Phrase.]");
//Update to display the Phrase
game.graphics();
System.out.println("[Press Anything to Continue.]");
input.nextLine();
//Ask if Player wants to Continue
game.continueplaying();
break;
case 5:
System.out.println("[You guessed everything.]");
//Update to display the Phrase
game.graphics();
System.out.println("[Press Anything to Continue.]");
input.nextLine();
//Ask if Player wants to Continue
game.continueplaying();
break;
case 6:
System.out.println("[Invalid Guess.]");
//Ask if Player wants to Continue
game.continueplaying();
break;
}
//Check if Replay
if(!(game.getGuessCount() >= 0))
{
game.continueplaying();
}
}
//Credits
System.out.println("_______________________");
System.out.println("| |");
System.out.println("| Thanks for Playing! |");
System.out.println("| - Cody Washington |");
System.out.println("| |");
System.out.println("‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾");
}
}