#include #include using namespace std; #include "robot.h" void robot::turnLeft(){ energy--; direction = (direction + 3) % 4; // a left is 3 rights } void robot::turnRight(){ energy--; direction = (direction + 1) % 4; } void robot::forward(int &x,int &y){ energy -= 2; if(direction == 0) y--; if(direction == 2) y++; if(direction == 1) x++; if(direction == 3) x--; } robot::robot(int id){ energy = 50; ID=id; moved = 0; direction = 0; } void robot::draw(){ cout << "#"; } void robot::print(){ cout<<"Robot "<