D
Dave Howell
Shawn W_ wrote:
=20
I think I got it. I did away with storing my cell data in a hash; = rather=20
I will put an array in each cell of the 2D array, and add another=20
parameter to the def [] and def []=3D methods to access it.
I don't recommend scrapping working code, but in the future, you might =
want to think about doing something a little more ruby-flavored. =
Something like, oh, maybe this....
def HexCell < Array
blah blah
end
ary =3D HexArray(3,4)
=3D> (Array of HexCells)
=3D> HexCell at [2,2]ary[2,3].neighborupperleft)
Delta would be defined like this:
Delta=3D{:center =3D> [0,0], :upperright =3D> [0.5,-1], :right =
=3D> [1,0], :lowerright =3D> [0.5,1], :lowerleft =3D> [-0.5,1], :left =3D>=
[-1,0], :upperleft =3D> [-0.5,-1]]