This site requires JavaScript, please enable it in your browser!
Greenfoot back
JHankins
JHankins wrote ...

2013/2/24

Help with code!

JHankins JHankins

2013/2/24

#
Our instructor had us copy and paste new code into the Ants 3 scenario for the food class. when I try to compile this section of code is giving me troubles. // If there are no crumbs left in this object ... / removeObject(this); // Why doesn’t this remove the Food object?? // otherwise.... // update image where it says removeObject(this); I get the error message invalid method declaration; return type required what am I doing wrong?
danpost danpost

2013/2/24

#
It appears that what your instructor gave you was pseudo-code (code written in english form -- but not actual code). You have to 'convert' it to real code that the compiler can understand. Unless you summarized your code for the discussion. If this is the case, please post the code for the class. It may be that your bracketing is off.
You need to login to post a reply.