def grid(self, cols, rows, colSize=<NUM_LIT:1>, rowSize=<NUM_LIT:1>, shuffled=False):
<EOL>from random import shuffle<EOL>rowRange = range(int(rows))<EOL>colRange = range(int(cols))<EOL>if (shuffled):<EOL><INDENT>shuffle(rowRange)<EOL>shuffle(colRange)<EOL><DEDENT>for y in rowRange:<EOL><INDENT>for x in colRange:<EOL><INDENT>yield (x * colSize, y * rowSize)<EOL><DEDENT><DEDENT>
Returns an iterator that contains coordinate tuples.
        The grid can be used to quickly create grid-like structures.
        A common way to use them is:
            for x, y in grid(10,10,12,12):
                rect(x,y, 10,10)