Beta

Swedish Tipping

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    What people think of as "significant" varies from human to human, but when developing your heuristic keep these things in mind:

    Sweden has 1, 5, and 10kr coins; and bills for 20, 50, and 100kr; although the 50 isn't used very often.

    One thing to note is that as the bill gets more expensive, the idea of what is "siginificant" for rounding up changes.

    This is equivalent to not providing any clear specs: what is the cutoff point between the next round-up interval? The kata expects this:

    bill < 100: 10
    bill < 1000: 20
    otherwise: 100
    

    But it could easily be the total bill with 5% accounted for, since that'd be the actual least paid amount.

    Again, this information is crucial to solving the kata but is being intentionally held back.

  • AzariasB Avatar

    This kata needs some random tests

    • SimplGy Avatar

      I wrote a pretty good amount of tests. Not intending to be combative, but what's the benefit of random tests?

    • AzariasB Avatar

      Well ... did you check my solution ? Random tests are here in part to avoid the user ability to "predict" the result

    • SimplGy Avatar

      I'm not sure how interested I am in preventing people from "cheating" if they want to do so, but I suppose it's worth trying as an exercise since I've never done random tests here before.

    • SimplGy Avatar

      added random tests, kinda fun.

      Issue marked resolved by SimplGy 9 years ago