-
Notifications
You must be signed in to change notification settings - Fork 0
/
FortuneTeller.java
90 lines (72 loc) · 2.89 KB
/
FortuneTeller.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
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
public class FortuneTeller {
public static void main(String[] args ) {
Scanner keyboard = new Scanner(System.in);
System.out.println ("Welcome to FortuneTeller_JP!");
System.out.println ("Answer the questions, and I shall divine your fortune!");
System.out.println ( );
System.out.println ("First, what's your name?");
String name = keyboard.nextLine();
System.out.println ("Enter a number between 1 and 8, or enter -1 to stop playing");
int number = keyboard.nextInt();
while (number != -1){
keyboard.nextLine();
for(int i = 1; i <= number; i++){
System.out.println ();
System.out.println (i);
}
System.out.println ("Enter a color (Red, Green, Blue, or Yellow)");
String color = keyboard.nextLine().toLowerCase();
int color2 = color.length();
for (int charIndex = 0; charIndex < color2; charIndex++) {
System.out.println(color.charAt(charIndex));
}
System.out.println (name + ", your fortune is as follows: ");
System.out.println ();
int number2 = number + color2;
if (number2 == 4){
System.out.println("Wear some brown pants next time you go to a scary movie (you'll thank me later).");
}
else if (number2 == 5){
System.out.println ("You're single and ready to mingle...and if you're in a relationship, you're ABOUT to single and ready to mingle!");
}
else if (number2 == 6){
System.out.println ("Something good is gonna happen...to the person next to you. Tough Luck buddy :^( ");
}
else if (number2 == 7){
System.out.println ("Keep your eyes to the ground, and you'll find a whooping 5 cents today!");
}
else if (number2 == 8){
System.out.println("You're gonna eat too much this Sunday - keep some Pepto Bismol at the ready.");
}
else if (number2 == 9){
System.out.println ("Disappointment is a part of life, so don't feel too bad once your next paycheck come in.");
}
else if (number2 == 10){
System.out.println ("Omae wa mou Shinderu.");
}
else if (number2 == 11){
System.out.println ("Get off the computer and socialize, you lazy bum!");
}
else if (number2 == 12){
System.out.println("There's a high chance that someone in the same building as you is/will be a murderer (Don't look behind you....).");
}
else if (number2 == 13){
System.out.println ("Someone will do a nice thing for you. Yay!");
}
else if (number2 == 14){
System.out.println ("You'll take a nice nap later on today.");
}
System.out.println ();
System.out.println ("Enter a number between 1 and 8, or enter -1 to stop playing.");
number = keyboard.nextInt();
}
while (number == -1){
System.out.println ("Farewell " + name + ", and may Lady Fortune continue to smile upon you!");
break;
}
}
}