Part 1 of 6 · 1 min read
Why this page comes last in Level 6
In this module you will
- Scope a large problem so that a core version fits in a round.
- Give each piece its own movement rule through polymorphism.
- Separate what a piece can do from what the game allows.
- Detect check, checkmate and stalemate by testing moves on the board.
- List the rules left out and say how each would be added.
Chess has many rules, so the main skill is deciding what to include. It is also the clearest case in this level where subclasses earn their place: the pieces differ in behaviour, and not just in data. The parking lot used an enum for vehicles for the opposite reason. This page uses the five steps of Level 0, module 4, and the polymorphism of Level 1, module 5. No book was supplied for this track, so the content is common practice, not from the books. The Java code was compiled and run before it was written here. Numbers marked "made up" only show the idea.