Hello,
"and are larger than 0.65 times the largest number in the array."
The rough idea is you mark only those numbers that are pretty big compared to the biggest number you have.
Precisely that are bigger than 65% of the biggest number. That makes about half of the value of the biggest number.
What to do
You do this only once, so do it in setup().
Loop the array, find the biggest number:
- int biggestNumber = -1000;
- for (int i=1;i<19;i++) {
- if (myArray[i][1]>biggestNumber)
- biggestNumber = myArray[i][1];
- } // for
or so.
Multiply it by .65 and store the result in a var biggestNumber65percent or so.
Then, when you do your if check in draw():
- if (myArray[i][0] > biggestNumber65percent)
Greetings, Chrisir