The compiler doesn't care about line breaks (new lines) - they are essentially the same as a space, except in special circumstances such as inside a "quoted string", and the end of line marks the end of a line comment (starting with "//").
The semicolon (";") is the statement separator.
It is generally a Good Idea to lay out your code in a clear-to-follow style, and not try to put too much all in a small visual space on the page.
Indentation, spacing between operators (such as "=" and "+"), and most of all consistency with your layout make it easier to read and understand, which ultimately helps you write better code and makes it easier for you to go back to it later for maintenance and/or enhancement.
In cases where you want to do something with a choice between two values, you can use the "ternary operator".
Many explanations can be found online, such as
Java Term of the Week: Ternary OperatorIn your case, you might try something like this:
Code:stroke( g[i] ? 0 : 255 );
The "magic numbers" here (0 and 255) might make better sense if you put them in variables (or constants), eg
Code:static final int G_ON_STROKE = 0;
static final int G_OFF_STROKE = 255;
stroke( g[i] ? G_ON_STROKE : G_OFF_STROKE );
I don't know what your g[] array values mean; hopefully you can come up with better names for the constants!
-spxl