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#

after i compile game.cs,i get a response telling me point 0,2 is not on the map...but its not true

1 Answer

Steven Parker
Steven Parker
231,261 Points

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.

Thanks! i removed the semicolon and it worked

Kent Γ…svang
Kent Γ…svang
18,823 Points

Good job. I tried to debug this for a couple of hours yesterday. Those damn semicolons are so easy to overlook, I didn't even consider the bug to be this simple.

Steven Parker
Steven Parker
231,261 Points

The compiler messages can save you a lot of time, but you need to get into the habit of checking both above and below the line number they point to.