Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( cloc == goal ) {
- while( astarmap[cloc.row][cloc.col].parent != 'X' ) {
- Location xloc;
- int d;
- rval.push(astarmap[cloc.row][cloc.col].parent);
- if ( astarmap[cloc.row][cloc.col].parent == 'N' )
- d = 2;
- else if ( astarmap[cloc.row][cloc.col].parent == 'E' )
- d = 3;
- else if ( astarmap[cloc.row][cloc.col].parent == 'S' )
- d = 0;
- else if ( astarmap[cloc.row][cloc.col].parent == 'W' )
- d = 1;
- else {
- assert(0);
- }
- cloc = getloc( cloc, d );
- }
- return rval;
- }
Add Comment
Please, Sign In to add comment