-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEightBallArray.java
41 lines (34 loc) · 1.68 KB
/
EightBallArray.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
import java.util.Random;
import java.util.Scanner;
public class EightBallArray {
public static void main(String []args){
String [] arr = {"It is certain.", "It is decidedly so.", "Without a doubt.", "Yes, definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."};
Scanner Scanner1 = new Scanner(System.in);
Random random = new Random();
boolean repeat = true;
int input;
String question;
while(repeat == true){
System.out.println("What question distrubs the balance?");
String userQueString = Scanner1.nextLine();
System.out.println("OK...");
System.out.println("Would you like to roll your fate? Yes(1) or No (2)");
int questionInput = Scanner1.nextInt();
int randNumber = random.nextInt(arr.length);
if(questionInput == 1){
System.out.println(arr[randNumber]);
}else if (questionInput == 2){
System.out.println("Scanner Closing...");
Scanner1.close();
}
System.out.println("New Questions? Re-wish? | Yes(1) or No(2)");
int userRepeat = Scanner1.nextInt();
if(userRepeat == 2 ){
Scanner1.close();
repeat = false;
}
}
}
}
// Yes, ik. Shitty code. :)
//My Freshman Year was funny AF :DDDD