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

192
Views
how do I repeat an image in java script using a for loop so that the picture is printed multiple times in the browser

so I have a little sailboat with a drawing of the moon and the sun. How would I create a for loop so that the sailboat, moon and the sun all are repeated across the x and y axis's without repeating the same instructions over and over. The code I made doesn't run when I save it and open the file.

for(var x = 0; x <= 600; x+200) 
                {
                    for(var y = 0; y <= 600; y+200)
                    {
                            drawWholeBoat(ctx, 200, 300); 
                    }
                }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Replace with this code, check comments for details:

for (let x = 0; x <= 600; x += 200) {
    for (let y = 0; y <= 600; y += 200) {
      drawWholeBoat(ctx, x, y);
    }
}
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!