5 kyu

Configurations of White and Black Knights on a 3x3 chessboard

Description
Loading description...
Fundamentals
Algorithms
Puzzles
Mathematics
Performance
  • Please sign in or sign up to leave a comment.
  • agkg Avatar

    Example 3 implies start_board and end_board might have different pieces, but out of all the test cases that's the only one where that's true. Maybe add some tests where there are different numbers of knights at the start and end?

  • dfhwze Avatar

    This kata seems to have performance constraints, but both the tag and performance requirements are missing from the description.

    • benjaminzwhite Avatar

      I'm not sure I understand @dfhwze - do you mean "performance" as in anti-Brute Force?

      There are quite a few different approaches using different logics/data structures and none with particular performance issues as far as I can tell? I will add the tag though to close issue, let me know if you want it removed subsequently.

      Thanks for the feedback as always,

      edit: Performance tag added

      Issue marked resolved by benjaminzwhite 3 years ago
    • dfhwze Avatar

      Yep, since brute force doesn't work, I consider this a performance kata.

  • dfhwze Avatar

    I have a feeling we are not required to alternate between W and B. This isn't according to standard chess moves. I find nothing in the description about this.

    You may only move one Knight at a time, and they follow standard chess move rules

    • benjaminzwhite Avatar

      Ah very good point - I have updated that in description to avoid confusion.

      To confirm; you are indeed correct - the "order of play" is not standard, any piece can be moved "next". You may move 1,2,3,...1814 white pieces before moving a single black piece and vice versa.

      edit: updated paragraph here for reference:

      • You may only move one Knight at a time, but - unlike in real chess - you may choose to move any number of White pieces without "swapping color" to Black, and vice versa for Black pieces. In other words, you can move 1,2,3,4,... White knights around the board before you move a single Black piece etc.
      Issue marked resolved by benjaminzwhite 3 years ago
    • dfhwze Avatar

      As a follow-up question; can a knight move to a square with another knight, and is that knight then taken from the board?

    • benjaminzwhite Avatar

      Ah nope, good point - that was in an earlier beta version but it was removed to keep it simple; I'll mention this explicity also.