Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. if(trobat){
  2. //cerr << "TROBAT " << p.i << ", " << p.j << " dist " << mapa[p.i][p.j] << endl;
  3. while (mapa[p.i][p.j] != 1) {
  4. for (int i = 0; i < 4 and mapa[p.i][p.j] != 1; ++i){
  5. Pos pdest = dest(p, a[i]);
  6. // cerr << "pos " << pdest.i << ", " << pdest.j << " dist " << mapa[pdest.i][pdest.j] << endl;
  7. if (mapa[pdest.i][pdest.j] != -1 and mapa[pdest.i][pdest.j] == mapa[p.i][p.j]-1) p = pdest;
  8. }
  9. }
  10. Dir d = calcular_dir(p);
  11. //cerr << "DIR " << d << endl;
  12. return d;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement