Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
I'm creating a dice game where the first one that reaches number 25 wins, but I can't make it when I get to 25 to score the winner

there is the example http://luislalo.com/game/

get the tabs direction

function getDirection(){
    let direction
    if((margenIzquierdo()==-39.2 && ((((margenArriba()*10)%(-19.6*10))/10)==0))
    || (margenIzquierdo()==0 && ((((margenArriba()*10)%(-19.6*10))/10)!=0))){
        direction = 'up'
    }
    else if((((margenArriba()*10)%(-19.6*10))/10)==0){
        direction = 'left'
    }else{
        direction = 'right'
    }

    return direction
}

I think the problem is here where i check the win and check the range, but i don't know why

function checarVictoria(){
    if(margenArriba()==-39 && margenIzquierdo()==0){
    document.querySelector('#p_turno').innerHTML = `${turno} ¡Player wins!`
    new Audio('win.mp3').play()
    return turno
}

else{
    return 'none'
}
}

check the range

function checarRango(dadoNum){
    let fueraDeRango = false
if(margenArriba()==-39.2 && (margenIzquierdo()+Number((dadoNum*-9.8).toFixed(1)))<0){
    fueraDeRango = true
}
return fueraDeRango
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda