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

145
Views
Devuelve 'Indefinido'

¿Cómo es que durante el "dibujar" cada Punto devuelve "indefinido" en lugar de una coordenada? ¿No es posible llenar una matriz durante la configuración?

 let a = []; var scl = 10; class Point { constructor(i, j) { this.x = i; this.y = j; } } function setup() { createCanvas(600, 600); for(x = 0; x < width; x += scl) { a[x] = []; for(y = 0; y < height; y += scl) { let p = new Point(x, y); a[x][y] = p; } } } function draw() { background(0); a.forEach( p => { rect(px, py, scl); }); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

a es una matriz bidimensional, necesita bucles anidados:

 function draw() { background(0); a.forEach(row => row.forEach(p => rect(px, py, scl))); }
about 4 years ago · Juan Pablo Isaza Report
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!