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 Loops and Final Touches While Loops

György Varga
György Varga
19,198 Points

Check my solution please! (Towers are on path)

Hi!

I've tried to examine if the Towers are on the Path. I wrote a method named 'OnPath' in the 'Path' class for this and in the 'Tower' class I called this method just like we've done it in the 'MapLocation' class. Can you please check it? It compiles, but I don't know if it's correct or not.

https://w.trhou.se/659x4d5j8n

Thank you for your help!

1 Answer

James Churchill
STAFF
James Churchill
Treehouse Teacher

György,

Did you try placing a tower on the path to see if you get the expected exception?

Thanks ~James