Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!