I'm working on implementing an A* search algorithm for a class.
I'm using javascript, for ease of UI. I've got a big grid of buttons.
I have an array of paths, sort them by their cost, and then pop the lowest cost path from the array and then expand it.
The problem is eventually, and inexplicably, this pop returns an undefined variable. Before popping, I check to see if the array is empty, and it isn't.
Any idea what the problem might be?
The page in question (still in development, only tested under Firefox):
http://asmor.com/school/a-star/