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!