Hey everyone,
I am implementing a BFS, and what it is going to do is go through an ordered tree to find the shortest solution to a puzzle.
What i will be doing is creating a Snapshot object that holds the current position of each piece in a puzzle. I will add this Snapshot object into the queue and check if it is the solution. However, I am creating these snapshots on the fly. So is there some kind of way that will automatically generate the names of the Snapshot objects when they are put into the queue?
or do i have to keep track of how many declarations i have made and just hard code it by saying...
Snapshot snapshot2; Snapshot snapshot3; Snapshot snapshot4; etc..