Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Robot::Robot(Arena* ap, int r, int c)
- {
- if (ap == nullptr)
- {
- cout << "***** A robot must be in some Arena!" << endl;
- exit(1);
- }
- if (r < 1 || r > ap->rows() || c < 1 || c > ap->cols())
- {
- cout << "***** Robot created with invalid coordinates (" << r << ","
- << c << ")!" << endl;
- exit(1);
- }
- m_arena = ap;
- m_row = r;
- m_col = c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement