Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

int moveRobots ( int * arg 0 , int * arg 1 , int arg 2 , int arg 3 ) { int i ,

int moveRobots(int *arg0, int *arg1, int arg2, int arg3)
{
int i,*ptrX,*ptrY, alive =1;
ptrX = arg0;
ptrY = arg1;
for (i=0;i<4;i++){
*ptrX = getNew(*ptrX,arg2); // update x-coordinate of robot i
*ptrY = getNew(*ptrY,arg3); // update y-coordinate of robot i
// check if robot caught user
if ((*ptrX == arg2) && (*ptrY == arg3)){
alive =0;
break;
}
ptrX++;
ptrY++;
}
return alive;
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

Show that X62 can be computed with only eight multiplications.

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago