Unless I’m missing something, this code should be correct. My goal was to make a circle (“Bubble”) which would be a random color. however, it says that I am missing curly brackets
“{” missing on line 4: int color = int(random(0, 7));
and “}” missing on line 38: }
Here is the full tab:
class BubRandCol
{
int[] rgb = new int[3];
int color = int(random(0, 7));
if(color == 0)
{
int[] rgb = {255,0,0};
}
if(color == 1)
{
int[] rgb = {255,128,0};
}
if(color == 2)
{
int[] rgb = {255,255,0};
}
if(color == 3)
{
int[] rgb = {0,255,0};
}
if(color == 4)
{
int[] rgb = {0,0,255};
}
if(color == 5)
{
int[] rgb = {128,0,128};
}
if(color == 6)
{
int[] rgb = {0,0,0};
}
if(color == 7)
{
int[] rgb = {255,255,255};
}
}
The only other tab I have says this:
void setup()
{
size(700, 500);
}