Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(trobat){
- //cerr << "TROBAT " << p.i << ", " << p.j << " dist " << mapa[p.i][p.j] << endl;
- while (mapa[p.i][p.j] != 1) {
- for (int i = 0; i < 4 and mapa[p.i][p.j] != 1; ++i){
- Pos pdest = dest(p, a[i]);
- // cerr << "pos " << pdest.i << ", " << pdest.j << " dist " << mapa[pdest.i][pdest.j] << endl;
- if (mapa[pdest.i][pdest.j] != -1 and mapa[pdest.i][pdest.j] == mapa[p.i][p.j]-1) p = pdest;
- }
- }
- Dir d = calcular_dir(p);
- //cerr << "DIR " << d << endl;
- return d;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement