-
-
Save parzibyte/06526e4a25b9867d70ae742e48901d43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const aleatorioDeArreglo = arreglo => arreglo[Math.floor(Math.random() * arreglo.length)]; | |
const agregarBotonAleatorioASecuencia = secuencia => secuencia.push(aleatorioDeArreglo(botones)); | |
const compararBotones = (boton, otroBoton) => { | |
return boton.attr("fill") === otroBoton.attr("fill"); | |
}; | |
const compararSecuenciaDeUsuarioConOriginal = (secuenciaOriginal, botonDeUsuario, indice) => { | |
return compararBotones(secuenciaOriginal[indice], botonDeUsuario); | |
}; | |
const refrescarPuntaje = puntaje => textoPuntaje.text(puntaje.toString()); | |
const reiniciar = () => { | |
secuencia = []; | |
puedeJugar = false; | |
contador = puntaje = 0; | |
refrescarPuntaje(puntaje); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment