sábado, 29 de dezembro de 2012

Routing (Part Two)

22-28th Dec 2012 - The 13th and 14th meeting dealed with routing. Starting on a Pointers solution to address variable number of moves.






Planing ahead
The second approach was to plan a route beforehand.  And while moving around, readjusting or recalculating the plan every time when encountering adversities, like new barriers. 
We needed a way  to store efficiently a different amount of moves for a route. 

 

Pointers attempt

The compiler used doesn't allow for dynamic memory allocation. As such, there's no variable length vectors. We thought we could use pointers to generate a variable list of nodes, that would store the cells to follow until the wanted destination. 
We did the a node structure with a position, a pointer to the previous node and a pointer to the next node. We built all needed functions to manage a pointer list like this during this holy week.

Sem comentários:

Enviar um comentário