-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathej10.js
More file actions
36 lines (32 loc) · 836 Bytes
/
ej10.js
File metadata and controls
36 lines (32 loc) · 836 Bytes
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
/*
Anterior pero 1 = 60% ; X = 30% ; 2 = 10%
*/
randomNumber = (min, max) => Math.round(Math.random() * (max - min) + min);
quinielitaAmañada = () => {
let i = 1;
let quiniela = "";
for (i; i < 15; i++) {
let result = randomNumber(1, 10);
switch (result) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
result = 1;
break;
case 7:
case 8:
case 9:
result = 'X';
break;
case 10:
result = 2;
break;
}
quiniela += `<p> Resultado ${i}: ${result} </p>`;
}
console.log('Resultados generados');
document.getElementsByClassName("quiniela")[0].innerHTML = (quiniela)
}