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 trialHamilton Mtungwazi
1,868 Pointsmy code is failing to compile and i cant find whats wrong
https://w.trhou.se/xjok6b99l4 what am i missing...someone help1
3 Answers
Steven Parker
231,198 PointsThat fresh snapshot is much better!
So there's currently only one version of "DistanceTo", and it takes 2 arguments. But you're calling it in MapLocation.cs with just one. Now it could be that you're in the middle of some changes and the course is about to have you make another version of "DistanceTo" that will work with the one argument.
But in case that's not it, or if you just want to make it compile anyway, you can convert the MapLocation object into separate X and Y values like this:
return DistanceTo(location.X, location.Y) <= range;
Steven Parker
231,198 PointsThat's the same workspace I looked at for you last Thursday, where it turned out there was a stray semicolon, remember? You said you removed the semicolon and it worked.
Are you having a different issue now? You'll need to make a fresh snapshot and post the link to that one.
Hamilton Mtungwazi
1,868 Pointsyes ,last week i removed the semi colon and it worked,however this time its a different problem,when i compile this it says
No overload for method DistanceTo' takes
1' arguments https://w.trhou.se/jdvhc1u21r
Steven Parker
231,198 PointsThat's still the same link to the old snapshot. A snapshot "freezes" the state of your workspace at the moment you make it. To show your current issue, you'll need to make a fresh snapshot and share that new link.
Hamilton Mtungwazi
1,868 PointsHamilton Mtungwazi
1,868 Pointshttps://w.trhou.se/xjok6b99l4 thats my current workspace
Hamilton Mtungwazi
1,868 PointsHamilton Mtungwazi
1,868 Pointsthanks steven,it compiled.........u the best!