The error's saying you're trying to use a variable that hasn't had a value assigned.
int startAt = 0, i, x = 0, y = 0;
It's generally better for readability to break these sorts of variables out to separate lines though, although that's just my preference.
var startAt = 0;
var x = 0;
var y = 0;
int i;
The first three can use var
because 0
can be inferred to be a 32-bit integer. The type for i
can't be inferred because it's set below.