Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Doing the 2 or 3 projects proposed at the end of C# Objects. This one is battleship, pretty simple, I don't think I have to explain the rules.
Welcome on anything is welcome, but I'm mostly looking for ways to improve my code. I'm also struggling with the concept of static methods, if someone could explain it to me it would be appreciated.
Steven Parker220,378 Points
Game improvement suggestions:
- allow "quit" anytime during game
- store shot history and warn against shooting in the same place twice
- display a summary status (hits/misses, enemy hits) on each turn
- display status as a grid showing hits and misses
- expand grid and have ships of different sizes like the traditional paper game
I'm not sure what issue you're having with static methods, but here's a significant distinction: Normal instance methods are applied to an instance of the class and may use and/or modify the instance it is called from, but static methods are applied to the class itself and can only use or affect arguments passed in.