7 kyu

Bob's Treasure Map

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Unnamed Avatar

    Some solutions consider lowercase characters as valid, but according to the description they aren't. Tests with lowercase nsew should be added.

    • dfhwze Avatar
      • added fixed test case
      • added sample test case
      • added random tests containing noize
      • shuffling random test input
      Issue marked resolved by dfhwze 2 years ago
  • Voile Avatar

    Needs a fixed test that has valid directions but expects [0,0].

  • FArekkusu Avatar

    Returning different data types is a bad practice.

    • user3254461 Avatar

      Thanks for the feedback! I changed all the cases so instead of returning false you have to return [] when the map is fake, hope that solves the issue and, if it doesn't, please let me know!

      Issue marked resolved by user3254461 6 years ago
    • FArekkusu Avatar

      IMO [0, 0] would make more sense considering wrong directions already provide (0, 0) change in coordinates for partially valid inputs. At least, it's not a boolean anymore.

    • user3254461 Avatar

      My reasoning for why I prefer [] over [0,0]:

      • I want fake maps to return [] because, in the logic of the kata, a fake map means there is no treasure to be found.
      • If it was [0,0], it could be confused with a real map that would just so happen to end up at (0,0).

      If you have any other suggestions, I would be happy to consider them.

    • FArekkusu Avatar

      In that case nil would be a lot more appropriate as its' purpose is signifying the absence of value.

    • Blind4Basics Avatar

      I'd second FArekkusu about that. :)

      Tho, there is another possibility: raise an exception.

    • user3254461 Avatar

      Thanks for the idea! nil would indeed be perfect, for some reason I didn't think about it...