How to override in for loop ?
in
Programming Questions
•
4 months ago
Hi_I'm not sure about the tittle but here's a problem I have:
I have four int array wich are:
distance[i] = milieu[i]
distance_dest[i] = milieu_dest[i];
I have a boolean array which tells me for each index wich is true, that distance[indextrue] = distance_dest[indextrue]. And other values stay distance[indexfalse] = milieu[indexfalse].
How could it be possible to compute such a weird thing ? ;-)
here's the code I have to clear this explanation:
thank you.
I have four int array wich are:
distance[i] = milieu[i]
distance_dest[i] = milieu_dest[i];
I have a boolean array which tells me for each index wich is true, that distance[indextrue] = distance_dest[indextrue]. And other values stay distance[indexfalse] = milieu[indexfalse].
How could it be possible to compute such a weird thing ? ;-)
here's the code I have to clear this explanation:
thank you.
- int distance[] = new int[9];
- int distance_dest[] = new int[9];
- boolean dest[] = new boolean[9];
- int milieu_dest[] = new int[9];
- int milieu[] = new int[9];
- void setup()
- {
- size(400, 400);
- }
- void draw()
- {
- for (int i = 0; i<9; i++)
- {
- distance[i] = milieu[i];
- distance_dest[i] = milieu_dest[i];
- }
- //I would like for each boolean true in the array => distance[i(boolean true)]=milieudest[i(boolean true)]
- // and the others values don't change.
- }
1