-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMixedMessages.js
52 lines (44 loc) · 1.01 KB
/
MixedMessages.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
//Random Number Generator
const who = Math.floor((Math.random()) * 3);
let word1 = ""
switch (who) {
case 0:
word1 = 'You';
break;
case 1:
word1 = 'Your Mum';
break;
case 2:
word1 = 'Your Dad';
break;
}
const whaaa = Math.floor((Math.random()) * 3);
let word2 = ""
switch (whaaa) {
case 0:
word2 = 'loves';
break;
case 1:
word2 = 'hates';
break;
case 2:
word2 = 'despises';
break;
}
const why= Math.floor((Math.random()) * 3);
let word3 = ""
switch (why) {
case 0:
word3 = 'women';
break;
case 1:
word3 = 'dancing';
break;
case 2:
word3 = 'football';
}
const phrase = () => {
if (word1 === 'You'){
word2 = word2.substring(0, (word2.length -1))};
console.log(`${word1} ${word2} ${word3}`)}
phrase()