Advertisement
here2share

# index_dict_overlap.py

May 14th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. # index_dict_overlap.py
  2.  
  3. MATRIX = {}
  4. tmp = []
  5. for y in range(10):
  6.     for x in range(10):
  7.         MATRIX[(x,y)] = []
  8.         tmp.append([0,(x,y)])
  9. for z in range(120):
  10.     at = tmp.index(min(tmp))
  11.     xy = tmp[at][-1]
  12.     MATRIX[xy].append(z)
  13.     tmp[at] = [tmp[at][0]+1,xy]
  14. for z in MATRIX:
  15.     print MATRIX[z]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement