shoebot/grammar/bot.py
def grid(self, cols, rows, colSize=1, rowSize=1, shuffled=False):
        """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)
        """
        # Taken ipsis verbis from Nodebox
        from random import shuffle
        rowRange = range(int(rows))
        colRange = range(int(cols))
        if (shuffled):
            shuffle(rowRange)
            shuffle(colRange)
        for y in rowRange:
            for x in colRange:
                yield (x * colSize, y * rowSize)
def grid(self, cols, rows, colSize=1, rowSize=1, shuffled=False):
        """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)
        """
        # Taken ipsis verbis from Nodebox
        from random import shuffle
        rowRange = range(int(rows))
        colRange = range(int(cols))
        if (shuffled):
            shuffle(rowRange)
            shuffle(colRange)
        for y in rowRange:
            for x in colRange:
                yield (x * colSize, y * rowSize)
def grid ( self , cols , rows , colSize = 1 , rowSize = 1 , shuffled = False ) : # Taken ipsis verbis from Nodebox from random import shuffle rowRange = range ( int ( rows ) ) colRange = range ( int ( cols ) ) if ( shuffled ) : shuffle ( rowRange ) shuffle ( colRange ) for y in rowRange : for x in colRange : yield ( x * colSize , y * rowSize )
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)
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 )