Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialArnaldo Zayas
577 Pointswondering where I'm going wrong
I've seen from other peoples questions that I could have simply written return TongueLength >= distanceToFly; in the Map class lesson the bool value was given a name so I wanted to as well, where am I going wrong in this approach?
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
public bool EatFly(int distanceToFLy)
{
bool inReach = TongueLength >= distanceToFly;
return inReach;
}
}
}
1 Answer
Steven Parker
231,248 PointsOne of Parker's Principles of Programming is "Typos and misspellings are the bane of tyros and gurus alike".
Arnaldo Zayas
577 PointsThat's a neat quote, kinda like the devil is in the details no matter who you are.
Arnaldo Zayas
577 PointsArnaldo Zayas
577 PointsI just got it, lol. Going to have to learn to be neater, It was a capital L in the distanceToFly paramater that had kept the code from running.