Log in

View Full Version : Can somebody help me with Java code?


Ann111111
Sep 12, 2013, 12:49 AM
A method called dropItems() taking a Robot and an integer. The robot should (try
to) drop that number of items.
My version doesn't work unfortunately. Here is it:

int dropBeepers(String input, int createRobot, int count) {
count =0;


while(isRobotCarryingItems()) {
dropItemFromRobot();
}
count++;
return(count);
}
}

Pelusawoman
Sep 14, 2013, 06:22 PM
Well, one problem is that count is coming in with a value, yes? Then you zero it, and if all goes well, you increment it to "1" and send it back. Is this really what you want to do?