>The code has the error: "expected unqualified-id before ‘return’", but I do not see any missing bracket or relevant. How is this going to be fixed?

I was referring to the code Mateusz posted. The other code with the recursion (reminds a lot of Prolog ;p) has the error variable or field ‘fill’ declared void
 When I am trying to enclose it in a class I phase many errors.