We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Why is it that Processing does not like the arrays to be put like this?
int[] NE = new int[4];
NE[0] = 60000;
NE[1] = 55000;
NE[2] = 45000;
NE[3] = 46000;
int[] ND = new int[4];
ND[0] = 80000;
ND[1] = 70000;
ND[2] = 40000;
ND[3] = 45000;
int[] F = new int[4];
F[0] = 60000;
F[1] = 35000;
F[2] = 24000;
F[3] = 28000;
int[] M = new int[4];
M[0] = 120000;
M[1] = 100000;
M[2] = 110000;
M[3] = 100000;
Answers
Your posted code works perfectly. And it's running in Processing's "static mode" now.
See the section "Hello Mouse" at the link below to know about static & interactive modes:
https://processing.org/tutorials/overview/
Now if you change it for the regular "interactive mode" it's not gonna work the way it is now.
Not b/c of Processing, but Java's!
In the section where we declare the class' fields, outside of any of its methods, regular statements aren't allowed! For example:
NE[0] = 60000;
However, if you really wish to run non-declaration statements there, we can place them inside a curly brace block:
But I particularly would go w/ this simpler form:
static final int[] NE = {60000, 55000, 45000, 46000};
Everything GotoLoop has said is correct but the following code shows 2 alternative ways of doing what you want
Verbose Code
Less verbose code