Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Oops. Should have tried to pass with the obvious, slow solution first. Spent a while working on a quick one.

    Lesson learnt!

    Well ... maybe more interesting solving my performance version :)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I made this a little harder by not reading the last bit on the instructions ... :)

  • Default User Avatar

    I really enjoyed the kata, and found it challenging, but I think (and please feel free to disregard this) maybe things need a tweak in some way ??? ... my preference would be to just ask for any solution (and change the return type to a single string).

    Though I can totally understand it was a lot of effort finding puzzles with unique solutions!

  • Default User Avatar

    If you're happy I'll mark this as resolved

  • Custom User Avatar

    Thanks @quantage ! Will take a look at your solution...
    Actually, in the description (and the note at the end) it is said that your C++ function should return ALL
    possible solutions (it's just a func prototype), but for this kata all problems have EXACTLY ONE solution.
    We could go 3 ways:
    a- keep it like it is (and may be make the description/notes/hints) more clear,
    b- add some cases with multiple solutions (with lexico sorting at the end, would be easy to test)
    c- add some 'no solution' cases (but that was not my first intention.

    Note: it was @@##++_ tricky to generate problems with exactly one solution, though.....

  • Default User Avatar

    Reading the comments below: if you're looking for suggestions of how to change the description then maybe just asking for any solution, and then validating could be a way to go. And possibly some unsolvable puzzles???

  • Default User Avatar

    Thanks for the kata. Easy to understand the problem ... tricky to solve. I enjoyed it :)

    I've bashed together a solution which passes the tests fine, with the caveat that it returns the first fit to each puzzle.
    The description asks to exhaustively search, but all tests have only a single solution.

  • Default User Avatar

    Glad you enjoyed it! It was my first Kata :)

    I'm half way through sorting out part 2, but am waiting for this to be approved before adding anything more. It seems to be a bit of a slow process.

  • Custom User Avatar

    Very nice kata!! I really like (I mean LIKE) those puzzles, where some maths are involved.
    Waiting for the next ones...

    Suggestion (seems it was not clear to @Voile, but was clear to me /see my solution and the 'check' stuff/)...
    Could be more precise 'You are supposed to sort all piece strings...\ lexicographically BEFORE stringifying the result string.

    To me: you could mark this issue as resolved.

  • Default User Avatar

    Hi there, and thanks for the feedback. I'll try to answer your points one at a time:

    1. "Sorted by what order?" ... the strings are sorted in the standard order, using standard string comparison.
    2. "The bounding boxes for pieces are not always cubes" ... correct
    3. "What is invalid input?" ... any input that does not conform to piece encoding specifications
    4. The tests don't test for invalid input ... correct ... I did have one but it seems to have gone missing - I'll add another one!

    Thanks.

    I have added some extra clarifications in the description.

    Any more feedback gratefully recieved.

  • Custom User Avatar

    Piece rotations should be returned in sorted order

    Sorted by what order? The bounding boxes for pieces are not always cubes, so the resulting rotations will have different dimensions, which cannot be compared directly.

    Expected: equal to "1+1 11 1|1"
    Actual: "1+1 1|1 11"
    

    (Also, no, "sort by stringified piece state" is lame and plain wrong. Please use something more proper.)

    Invalid input should return an empty string

    What is a "invalid input"? It's not mentioned anywhere, and the tests don't test this anyway.