Generating grid patterns

I’m trying to generate some simple grid patterns, working from the tutorial here :

In particular I am trying to make a diamond shape similar to this : But am struggling with the math as to how I can identify this pattern from my grid.

if any one has any links or code that may be helpful, that would be great.

I have attached the .FLA I am working from if you want to take a look.

thanks! :trout: