Ad
  • Custom User Avatar

    Description improved by lechevalier

  • Custom User Avatar

    Fixed! No idea how that happened, I guess I must've had that brace selected and hit enter or something during testing.

  • Custom User Avatar

    Approved!

  • Custom User Avatar

    fixed + made description language-agnostic

  • Custom User Avatar

    thx

  • Custom User Avatar

    It seems like some kind of disorder.

  • Custom User Avatar

    Everyone already knew

  • Custom User Avatar

    If the next small gift is beyond the specified distance from the current gift, but not further away from your home base than the nearest gift on the opposite side, if such gift exists on the opposite side, proceed to collect it.

  • Custom User Avatar

    Ok, I'll change the description. Feel free to add a Rust translation. Just make sure there are some kind of performance constraints. Naive collecting back and forth must time out.

  • Custom User Avatar

    You are talking about this case:

    "..b...a..@........"

    The rules state:

    • Basic Rule: In scenarios with multiple gifts, prioritize collecting the one nearest to your position. -> go for "a"
    • Advanced rules outline scenarios where a second gift can be acquired alongside the primary gift selected using the basic rules. -> check each of the advanced rules
      • If there's another small gift further in the same direction, and the distance between that gift and the current one is less than or equal to the distance between the current gift and your home base, collect it as well. -> not the case, "b" is too far
      • If the next small gift is beyond the specified distance from the current gift, but not further away from your home base than the nearest gift on the opposite side, proceed to collect it. -> not the case, no gifts in opposite direction
      • A heavier gift cannot be collected simultaneously, as it would exceed your carrying capacity. -> not the case, no heavier weight
      • If the next small gift doesn't meet any of the aforementioned conditions, leave it behind. -> bingo: pick "a", go home, pick "b", go home

    Tell me how the specification could be misinterpreted?

    Would it help to add these test cases? Second test case could also be solved just walking through rule by rule.

    "..b...a..@........" ==> "ab" // first collect "a", go home, then "b", go home
    
    "....b.a..@..z....." ==> "baz" // first collect "ba", go home, then "z", go home
    
  • Custom User Avatar

    If the next small gift doesn't meet any of the aforementioned conditions, leave it behind.

  • Custom User Avatar

    While I agree, it was still a fun, out-of-the box kata :-)

    But sure, if you don't get it in a few minutes, don't waste time on it, and don't feel bad about it either.

    Cheers

  • Custom User Avatar

    I did the changes in a fork, so that this one stayed in place in the meantime.

    I had already setup parallel Java and Kotlin type generation, so I just removed the messy "Invalid Kotlin" generation and switched it out for creating a vector of tokens and changing 1 token.

  • Custom User Avatar
  • Custom User Avatar

    using the name gg and the random tests not being very random are for consistency with the kata in other languages, but I'll do the changes you suggested

    I did already change my haskell translation to use QuickCheck to generate random type-ASTs, but that only generates valid types

  • Loading more items...