Skip to content

Implementing multi-step exercises? #5

Description

@IanWhitney

Today my Kata group discussed solutions for Queen Attack. We all thought it would be interesting to have some follow-up exercises. The idea is that the student would build-on and modify their code from the earlier exercises to solve later exercises.

One possible set of exercises could be:

  1. Can 2 queens attack each other? (this is the standard set of queen attack tests)
  2. Can 2 knights attack each other?
  3. Given a board with a queen and knight, who can attack whom?
  4. Given a board with 2 queens and 2 knights, who can attack whom?

Each exercise would introduce a new wrinkle into the existing code. Moving from Exercise 1 to 2 would get students thinking about different piece types, what behavior they have in common and what behavior they do not.

2 -> 3 Would introduce the ideas of non-reciprocal attacks. If queen A can attack queen B, then the reverse is true. Same for knights. But if a queen can attack a knight, then the reverse is false.

3 -> 4 Is a big leap. You have to introduce a board concept, because you have to start thinking about other pieces being in your way. Yes, that queen might be diagonal from your queen, but there's a knight in your path. Etc.

And so on. You can take this pretty far, obviously.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions