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 trial

C#

in c# objects,after i compile my code in game.cs ,it says 0,2 is outside the boundaries of the map.

after jeremy compiled game.cs, 0,2 is the answer as this is a point on the map,however when i compile mine it says 0,2 is outside the boundaries of the map.https://w.trhou.se/jdvhc1u21r

Steven Parker
Steven Parker
231,261 Points

To facilitate analysis, make a snapshot of your workspace and post the link to it here.

A link to the course page you are working with might be helpful also.

3 Answers

Steven Parker
Steven Parker
231,261 Points

Wait .. didn't I already answer this question? Anyway, here's the answer I gave 3 hours ago.

When building the project I got this message:

MapLocation.cs(8,12): warning CS0642: Possible mistaken empty statement

And when I looked in Maplocation.cs, on line 7 I found a stray semicolon at the end of the line after the conditional expression.

That was causing the code block below it to be executed every time, regardless of the condition.

okay thanks steven,here it is https://w.trhou.se/jdvhc1u21r

In MapLocation.cs your if statement has a semicolon at the end.

if (!map.OnMap(this));

This will result in the result of the if being ignored and the block immediately after being executed regardless of the result.