I have been working in jQuery and I was given this code for a quadtree in javascript:
map = array(
array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4)),
array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4)),
array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4)),
array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4))
);
map[0][3][3] = "END OF ARRAY 1";
map[1][3][3] = "END OF ARRAY 2";
However this just looks like a 3d array to me, am I being stupid? ^.^
Since all nodes have exactly four children it is a quadtree. It is also a 3D array, since it is three levels deep.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With