Yeah the problem lies in your
validMove function. Notice that you don't have a return statement for the situation where
numSticks is less than or equal to 1. Your inner if statement never gets executed and then the function attempts to end without returning anything. So all you need to do is put in a return statement there.
CODE
private boolean validMove(int numSticks) {
// YOUR CODE GOES HERE
if (numSticks > 1)
{
if (numSticks < 3)
{
return true;
}
else return false;
}
// numSticks was less than or equal to 1 so return false
return false;
}
As you can see from the code above, we put in the return statement of false at the end just in case the numSticks was less than or equal to one. Remember that you must cover "all paths of execution" with your return statements.
This will fix your problem. Enjoy!