Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1.         if(w.hasStench(x+1, y)){
  2.             if(isWumpus(x+1+1, y)){
  3.                 return true;
  4.             }
  5.             else if(isWumpus(x+1, y+1)){
  6.                 return true;
  7.             }
  8.             else if(isWumpus(x+1, y-1)){
  9.                 return true;
  10.             }
  11.         }
  12.         else if(w.hasStench(x, y+1)){
  13.             if(isWumpus(x+1, y+1)){
  14.                 return true;
  15.             }
  16.             else if(isWumpus(x, y+1+1)){
  17.                 return true;
  18.             }
  19.             else if(isWumpus(x-1, y+1)){
  20.                 return true;
  21.             }
  22.         }
  23.         else if(w.hasStench(x-1, y)){
  24.             if(isWumpus(x-1, y+1)){
  25.                 return true;
  26.             }
  27.             else if(isWumpus(x-1-1, y)){
  28.                 return true;
  29.             }
  30.             else if(isWumpus(x-1, y-1)){
  31.                 return true;
  32.             }
  33.         }
  34.         else if(w.hasStench(x, y-1)){
  35.             if(isWumpus(x+1, y-1)){
  36.                 return true;
  37.             }
  38.             else if(isWumpus(x-1, y-1)){
  39.                 return true;
  40.             }
  41.             else if(isWumpus(x, y-1-1)){
  42.                 return true;
  43.             }
  44.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement