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

142
Views
Is there a way to have p5js run the same script multiple times but to read different input parameters each time? Is it possible to convert to an exe?

I was wondering if it is possible to convert a complex p5js project to an executable that would allow me to run it many thousands of times but with different input parameters? Alternatively, is it possible to loop and reset the same script many times and only update the input parameters?

A very simple example is given below

function setup() {
 
  i = 1;
  c = createCanvas(400, 400);

  colorMode(HSB, 1);

  C_array = [];
  for (i = 0; i < 10; i++) C_array[i] = 1 / i;

}

function draw() {
  background(C_array[i], 1, 1);

  saveCanvas();
  i++;
  c.reset;
}

UPDATED

I am attempting a different way now and trying to have the page reload after each sketch finishes just after saving the image. The problem is it either saves a load of exactly the same image or it reloads too quickly before the image can be saved.

function setup() {
   
  i = 0;
  c = createCanvas(400, 400);

  colorMode(HSB, 1);

a=random();
}

function draw() {
  background(a, 1, 1);

  i++;
    
  if(i>120){
  saveCanvas();
    location.reload
  }
}

Many thanks in advance!

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!