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:
- Can 2 queens attack each other? (this is the standard set of queen attack tests)
- Can 2 knights attack each other?
- Given a board with a queen and knight, who can attack whom?
- 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.
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:
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.