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

140
Views
Estoy haciendo un juego mancala; y necesita ayuda para averiguar cómo mover las 'canicas' a cada hoyo. Estoy pensando que una declaración if es el camino a seguir, pero perdí

Esto es lo que tengo hasta ahora. Puedo apuntar a los pozos y las semillas en sí. Mis 'semillas' son solo un número que se muestra en los pozos. Todavía no he apuntado al almacenamiento, así que tal vez debería definir una variable que pueda. Puedo actualizar el siguiente número de boxes, pero los siguientes no se actualizan

 /// event listener to hear pits clicked allPits[i].addEventListener('click', () => { /// targeting pits indivually but also the seeds amount within let currentSeeds = allPits[i].dataset.seed // hitting and changing hardcode html-- 4-4=0 allPits[i].innerHTML = allPits[i].dataset.seed - currentSeeds console.log('clicked:', allPits[i]) console.log(allPits[i+1]) ///interating thru the following pits to add a seed allPits[i+1].dataset.seed++ console.log('add', allPits[i+1].dataset.seed) //changing the hardcoded 4 to +1 to add to the next pits seed count allPits[i+1].innerHTML = allPits[i+1].dataset.seed //for loop to finish out the previous code for(let k = 0; k < currentSeeds; k++){ console.log('currentseeds', currentSeeds) //delivers the +1 seed to next pit currentSeeds[k] = allPits[i+k] } }) }
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!