Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions baloto.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Arreglo original
const colorLoto = ['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'N1', 'N2', 'N3', 'N4', 'N5', 'N6', 'N7', 'R1', 'R2', 'R3', 'R4', 'R5', 'R6', 'R7', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6', 'V7', 'Z1', 'Z2', 'Z3', 'Z4', 'Z5', 'Z6', 'Z7'];
const baLoto = ['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'];
const colorLoto = ['3BL', '4BL', '6BL', '6AM', '7AM', '3NG', '6NG', '2RJ', '1VD', '3AZ', '4AZ', '7AZ'];
// const baLoto = ['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'];
// const colorLoto = ['1BL', '2BL', '3BL', '4BL', '5BL', '6BL', '3AM', '5AM', '6AM', '7AM','6NG', '7NG', '1RJ', '2RJ', '3RJ', '4RJ', '5RJ', '6RJ', '7RJ', '1VD', '2VD', '5VD', '6VD', '7VD', '3AZ', '4AZ', '5AZ', '7AZ'];
const baLoto = ['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'];
const miLoto = ['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'];
const superBalota = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16'];
// Arreglo para almacenar los resultados
let resultados = [];
let arregloCompleto = [];
// Función para seleccionar y eliminar un elemento aleatorio
function seleccionarAleatorio(array) {
const indiceAleatorio = Math.floor(Math.random() * array.length);
Expand All @@ -15,9 +18,9 @@ function seleccionarAleatorio(array) {

function mezclar(nombreArreglo, numeroApostar){
resultados = [];
const arregloUtilizado = eval(nombreArreglo);
arregloCompleto = eval(nombreArreglo).slice(); // crear el respaldo del arreglo original
for (let i = 0; i < numeroApostar; i++) {
const elementoSeleccionado = seleccionarAleatorio(arregloUtilizado);
const elementoSeleccionado = seleccionarAleatorio(eval(arregloCompleto));
resultados.push(elementoSeleccionado);
}
document.querySelector('.input-1').value=resultados;
Expand Down
Loading