arrays and for loops
in
Programming Questions
•
6 months ago
HI guys im just wondering why c = a*b/2; brings up no results for println(c) but c = 100; or some whole number does work. im just playing around with arithmetic series here and wanted to know how i could construct c interms of a and b
Series series;
void setup(){
background(255);
size(500,500);
series = new Series(10,11);
}
void draw(){
series.move();
}
class Series{
int a;
int b;
int[] n;
int c=a*b/2;
Series(int a_,int b_ ){
n = new int[c];
a = a_;
b = b_;
}
void move(){
for (int c= 0;c<n.length;c++){
n[c] = n[c]+1;
println (c);
}
}
}
1