Hey guys, I've been trying to make a pathfinding algorithm (of which I'm sure there are many better ones out there with more braintime poured into them but whatever), and I realized that I need a history >1 element deep if I'm going to search all 8 neighbouring pixels around every pixel.
The problem is how do I implement this. If white pixels represent the path, then the oldest white pixel added to this data element should be deleted if adding a new one would exceed a predetermined size of this data element. The problem is what is this data element? A queue sounds like the solution, but according to cplusplus.com a queue doesn't let you look at the values of the elements in between the first and last element. I need to compare the position of a white pixel with at least 5 positions of other white pixels to prevent the algorithm from chasing its own tail. But cplusplus says you can only access the front and back of a queue, and everything in between is... well, you can't look at it to compare the positions. So what should I do?