Guest User

Untitled

a guest
Dec 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. if (abs(x - this->getLocX()) == abs(y - this->getLocY())) // THIS WORKS GOOD
  2. {
  3. cout << "n" << abs(x - this->getLocX()) << abs(y - this->getLocY()) << x << y;
  4. for (int i = 0; i < abs(x - this->getLocX()); i++)
  5. {
  6. cout << "n" << boardP->hasPiece(this->getLocX() - 1, i-1) << "n" << boardP->hasPiece(i, y) << "n" << x << "n" << y << "n" << i << "n";
  7. if (boardP->hasPiece(this->getLocX() - 1, i-1)) // THIS DOESNT WORK
  8. return 0; // THERE ARE PLAYERS IN THE WAY
  9. }
  10. return 2; // THERE ARE NO PLAYERS IN THE WAY
  11. }
  12. return 0;
Add Comment
Please, Sign In to add comment