Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2012 06:04
Show Gist options
  • Save anonymous/3074475 to your computer and use it in GitHub Desktop.
Save anonymous/3074475 to your computer and use it in GitHub Desktop.
from point_class import Point
from quad_tree_class import QuadTree
import pprint
import sys
pt1 = Point(0,0)
points = []
for i in range(-2,1):
for j in range(-2,1):
if i is 0 and j is 0:
continue
tmp = Point(i,j)
points.append(tmp)
#for pt in points:
# print pt
qt = QuadTree(pt1)
for pt in points:
try:
qt.insert(pt)
except:
"That point already exists in the tree. Try harder."
print qt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment