I'm writing a program that puts new instances of a class into an array. As far as I can tell, my syntax are correct, but I'm getting an unexpected token error on line 2. The main body of the program is copied below, with the class definition below it.
Thank you in advance for any help!
Main Program:
Grid[] grids = new Grid[2];
grids[0] = new Grid (color (244, 50, 63));
grids[1] = new Grid(color (237, 7, 184));
void setup () {
size (500, 500);
background (255);
grid [1];
grid [0];
}
void draw () {
gridtwo.drawGridbottomright ();
gridone.drawGridbottomleft ();
gridone.drawGridtopright ();
gridtwo.drawGridtopleft ();
}
Class
class Grid {
color strokecolor;
Grid (color tempstrokecolor) {
strokecolor = tempstrokecolor;
}
void drawGridtopleft () {
int counterX, counterY, counter1, counter2, counter3, counter4;