Skip to content

Instantly share code, notes, and snippets.

@jhgaylor
Forked from anonymous/gist:3074329
Created July 9, 2012 05:16
Show Gist options
  • Select an option

  • Save jhgaylor/3074340 to your computer and use it in GitHub Desktop.

Select an option

Save jhgaylor/3074340 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(-3,2):
for j in range(-3,2):
tmp = Point(i,j)
points.append(tmp)
#for pt in points:
# print pt
#printPoints(points)
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