TankorSmash

gridding

Mar 19th, 2012
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. #----------------------------------------------------------------------
  2. def createGrid():
  3.     """"""
  4.     width = 800
  5.     height = 600
  6.     gridsize = 5
  7.     wByG = width / gridsize
  8.     hByG = height / gridsize
  9.    
  10.     grids = []
  11.     for h in range(hByG):
  12.         widths = []
  13.         for w in range(wByG):
  14.             groups = []
  15.             for i in range(gridsize):
  16.                 x = (gridsize * w) + i
  17.                 groups.append((x, h))
  18.             widths.append(groups)
  19.         grids.append(widths)
  20.     import pprint
  21.     #all > line > grouping
  22.     pprint.pprint(grids)
Advertisement
Add Comment
Please, Sign In to add comment