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

189
Views
For loop no parece estar ejecutándose con la más mínima señal, ¿alguien tiene alguna solución?

Extrañamente, el bucle for no parece ser llamado. La alerta dirá 1 pero 2 no se mostrará. No hay ningún error en la consola, y los verificadores de código en línea (específicamente JShint.com) dicen que no hay ningún problema.

 window.onLoad = function() { var l = 1; const S = "Spawn"; const N = "Next"; const K = "Kill"; const LEVEL = [ [ [5, 5], [1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, S, K, N, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1] ] ] const PSIZE = 54; var SCR = document.getElementById("SCR"); const context = SCR.getContext("2d"); drawMap(); } function drawMap() { let w = LEVEL[l - 1][0][0]; let h = LEVEL[l - 1][0][1]; alert("1") for(let lx = 0; lx == w - 1; lx += 1) { for(let ly = 1; ly == h; ly += 1) { let tile = LEVEL[l - 1][ly][lx]; switch(tile) { case 1: context.fillColor = "grey"; break; case 0: context.fillColor = "white"; break; default: context.fillColor = "red"; break; } alert(2) context.fillRect(((lx + 1) * PSIZE), ((ly + 1) * PSIZE), PSIZE, PSIZE); } } }
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!