-
Notifications
You must be signed in to change notification settings - Fork 0
/
eightBall.js
53 lines (45 loc) · 971 Bytes
/
eightBall.js
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
// Eight Ball
// step one
let userName = 'Jhonny';
// step two
userName ? console.log(`Hello, ${userName}!`) : console.log('Hello!');
// step three
let userQuestion = 'How the day is today?'
//step four
console.log(userQuestion);
// step five
let randomNumber = Math.floor(Math.random() * 8)
// console.log(randomNumber);
// step six
let eightBall = '';
// step seven
switch (randomNumber) {
case 0:
console.log('It is certain');
break;
case 1:
console.log('It is decidedly so');
break;
case 2:
console.log('Reply hazy try again');
break;
case 3:
console.log('Cannot predict now');
break
case 4:
console.log('Do not count on it')
break;
case 5:
console.log('My sources say no')
break;
case 6:
console.log('Outlook not so good')
break;
case 7:
console.log('Signs point to yes')
break;
default:
console.log(`Sorry, im out of balls.`);
break;
}
console.log(`${eightBall}`);