vendredi 23 décembre 2016

How do I call a function to run in a graph window in a specific pattern?

I have a function with objects that has to run at specific points in the graph window.

Each line represents the function (100x100) in what it is supposed to be a 500x500 window.

-----
 ---
  -
 ---
-----

I know how to make it run like this:

-----
-----
-----
-----
-----

by using nested loops.

def AssortmentOfObjects(size):
    win =GraphWin("Object assortment", size,size)
    ypoint = 0
    for y in range(5):
        xpoint = 0
        for x in range(5):
            Objects(win, xpoint, ypoint)
            xpoint = xpoint + 100
        ypoint = ypoint + 100

Apparently you can use if statements to make them run in a tessellation.
I just have no idea how.

Thank you for any help! Much appreciated.

Aucun commentaire:

Enregistrer un commentaire