ujh/iomrascalai — pull request #3 by TisButMe (2014-05-15 07:27:54+00:00)
Title: Change board representation to matrix

After talking at length on Rust's IRC with eddyb and other Mozilla employees, I was told that using a Vec with a matrix representation was way more efficient on modern CPUs than using Vec>.

This PR changes the way the board is stored, and the points accessed to increase efficiency.

I have also introduced a board.neighbours(Point) method, which builds a vector of points N-S-E-W of the given Point, if they exist. I'm using a mutable state in there, which I dislike, but I don't know how else to do it. It would also probably be way more efficient to manually check for each NSWE coords, instead of using 2 for loops, as they're also going over the diagonals and the point itself. Oh well...