-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (45 loc) · 2.07 KB
/
index.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
let Options = [ 'piedra', 'papel', 'tijeras', 'lagarto', 'spock']
let randomOptions = Options[Math.floor(Math.random()* Options.lenght)]
let person = prompt("¿Cual opcion deseas? : piedra, papel, tijeras, lagarto o spock")
person = person.toLowerCase()
if (person == 'tijeras' && randomOptions == 'papel') {
console.log('You win!')
} else if (person == 'papel' && randomOptions == 'piedra') {
console.log('You win!')
} else if (person == 'piedra' && randomOptions== 'lagarto') {
console.log('You win!')
} else if (person == 'lagarto' && randomOptions== 'spock') {
console.log('You win')
} else if (person == 'spock' && randomOptions == 'tijeras') {
console.log('You win!')
} else if (person == 'tijeras' && randomOptions == 'lagarto') {
console.log('You win!')
} else if (person == 'lagarto' && randomOptions== 'papel') {
console.log('You win!')
} else if (person == 'papel' && randomOptions== 'spock') {
console.log('You win')
} else if (person == 'spock' && randomOptions== 'piedra') {
console.log('You win')
} else if (person == 'piedra' && randomOptions== 'tijeras') {
console.log('You win')
} else if (person== 'papel' && randomOptions == 'tijeras') {
console.log('You loose!')
} else if (person== 'piedra' && randomOptions == 'papel') {
console.log('You loose!')
} else if (person== 'lagarto' && randomOptions== 'piedra') {
console.log('You loose!')
} else if (person == 'spock' && randomOptions== 'lagarto') {
console.log('You loose')
} else if (person== 'tijeras' && randomOptions == 'spock') {
console.log('You loose!')
} else if (person== 'lagarto' && randomOptions == 'tijeras') {
console.log('You loose!')
} else if (person== 'papel' && randomOptions== 'lagarto') {
console.log('You loose!')
} else if (person == 'spock' && randomOptions== 'papel') {
console.log('You loose')
} else if (person == 'piedra' && randomOptions== 'spock') {
console.log('You loose')
} else if (person == 'piedra' && randomOptions== 'tijeras') {
console.log('You loose')
}