Advertisement
Guest User

Robot

a guest
May 30th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. Robot::Robot(Arena* ap, int r, int c)
  2. {
  3.     if (ap == nullptr)
  4.     {
  5.         cout << "***** A robot must be in some Arena!" << endl;
  6.         exit(1);
  7.     }
  8.     if (r < 1 || r > ap->rows() || c < 1 || c > ap->cols())
  9.     {
  10.         cout << "***** Robot created with invalid coordinates (" << r << ","
  11.             << c << ")!" << endl;
  12.         exit(1);
  13.     }
  14.     m_arena = ap;
  15.     m_row = r;
  16.     m_col = c;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement