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# C# Objects Methods Methods

Beverly Lee
Beverly Lee
1,084 Points

inBounds/outOfBounds: why if the Y = Height does it become outofBounds and not inBounds?

why if the Y = Height does it become outofBounds and not inBounds? Why isn't Y <= Height techincally inbounds?

Same goes for outOfBounds = point.X >= Width

1 Answer

Tomasz Necek
PLUS
Tomasz Necek
Courses Plus Student 7,028 Points

"zero base counting" rule:)

However, in programming, by convention we start counting from zero.
3:30
This means that the point on the bottom left corner of the map is 0.00.
3:36
And the rightmost point has an x value of one less than the width.
3:42
The topmost point has a y value of one less than the height.
3:47
This is called zero base counting.
3:50
This throws a lot of people off.