currently running through an example in my book and i am continuing to get an error saying class , interface or enum
import greenfoot.*;
/**
* This class defines a crab. Crabs live on the beach.
*/
public class Crab extends Actor
{
public void act()
{
turnAtEdge();
randomTurn();
move(5);
lookForWorm();
}
}
/**
* Check whether we have stumbled upon a worm.
* If we have, eat it. If not, do nothing.
*/
public void lookForWorm())
{
if ( isTouching(Worm.class ))
{
removeToucing(Worm.class);
}
}
/**
* Crab randomly turns
* -45 to 45 degrees
*/
public void randomTurn()
{
if ( Greenfoot.getRandomNumber(100)<10)// Add your action code here
{
turn(Greenfoot.getRandomNumber(90)-45);
}
}
/**
* Crab checks if it is at edge
* If correct, turns. If not, move forward.
*/
public void turnAtEdge()
{
if ( isAtEdge())
{
turn(17);
}
}