Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda