Yeah, that compiles so great!
Just wondering if ..
Robot* otherRobotAt(Robot* rp) const
// If there is at least one robot (other than the one rp points to)
// at the same (r,c) coordinates as the one rp points to, return a
// pointer to the one of those other robots with the least amount
// of energy remaining (if there's a tie, any one of the tied robots
// will do); otherwise, return NULL.
//
{
}
would follow the same idea as
bool Valley::energySourceAt(int r, int c) const
{
for (int k = 0; k < m_nsources; k++)
{
if ((m_sources[k]->row()== r)
&& (m_sources[k]->col()== c))
return true;
}
return false;
} where we have to check each robot now, at each row and column to see if they match. It true, return .. a this?