Hi guys!
I’m just playing around processing to learn and understand it.
But I stumbled upon a really basic problem: Where does the return function return to?
After the function has done their job it should return the value, because I wanna save it to calculate an average, or whatever.
int var;
void setup() {
}
void draw() {
for (int i=1; i<=10; i++) {
tues(i);
if ( i>=10) {
noLoop();
}
}
}
int tues(int a) {
int quad = a*a;
println(a + "² = " + quad);
return quad;
}
AFAIK the value of quad gets returned to where the function was called (so I guess it must be inside the loop, right?). But when I try to get the value of quad it always says that there is no variable available.
So where does the value gets returned to?
Thanks in advance =)
Eric