• Nice kata, very clear description, pleasant to read and follow. Thanks!

  • Nice kata. always nice to see a greedy algorithm

  • 'defined it as real frozen constant (but I never saw any actual change to the object in the tests... might have been updated in the meantime...)

  • updated JS, freezing the object and its arrays. Added a note about that to the description.
    That should resolve that problem.

    Closing.

  • ok, now this is understandable.

    first point: I bet you're mutating the lists using reverse without creating a copy. So there are 2 problems here: 1/ you shouldn't mutate the constant object, and 2/ the general design isn't good (I'll see to add a check that the data isn't modified)

    second point: smallest amount of bank notes should be used means that you should use the smallest amount of bank notes, not the bank notes with the smallest amount.
    edit: I misread the order of the log message, lemme check further
    edit²: ok, I checked, and with a correct solution, the reference solution is returning the "should be expected result", meaning: 3 * 500 EUR, 1 * 200 EUR, 1 * 50 EUR, 1 * 10 EUR, 1 * 5 EUR. So I guess it's actually the very same problem than the first point.

  • In Javascript the random tests don't seem to respect the description of the Kata and the logic of the basic and random-like tests. There's at least two issues:

    • Returned message if value cannot be divisible uses wrong bank note (the smallest bank note should be used).
      Expected: 'Can\'t do 4246 EUR. Value must be divisible by 500!', instead got: 'Can\'t do 4246 EUR. Value must be divisible by 5!'
    • The smallest amount of bank notes should be used (therefore starting with bigger bank notes to smaller).
      Expected: '353 * 5 EUR', instead got: '3 * 500 EUR, 1 * 200 EUR, 1 * 50 EUR, 1 * 10 EUR, 1 * 5 EUR'
  • Sorry I wasn't more specific. I'll add the issue again.

  • what do you even mean...?

    if you open issues, plz do it properly, not using only vague sentences. Here, if Iwere about to tackle this I'd have no idea what this is about. Closing. Feel free to open a clear and detailed issue, tho.

    Generic message, so that we're on the same page about some definitions (most doesn't apply here, but I'm confident you'll find what is relevant by yourself)


    • Issue: problem in the kata itself (description, wrong tests, wrong internal solution...)
    • Suggestions: well, I guess that part is clear
    • Question anything else that is related to you having a problem solving a kata -> that's you, currently.

    When you post issues:

    • provide ALL the useful information:
      • language
      • input
      • outputs (actual expected) when relevant
      • error message when relevant
    • check, DOUBLE check that this IS an issue, meaning that the problem is in the kata itself and not in your code. If it's in your code, post rather a question
    • if you pass this step, you still have to prove/explain what the issue is (and if you can provide fixes, it's even better)

    When you post a question: well, most of the above apply too x)

    When you post code, use proper github markdown, so that it's readable.

    cheers

  • Can someone FIX the auto tests or BRING DOWN the Kata for javascript altogether? This is ridiculous...

  • Putting a mutable global variable VALUES that are changed during testing is just plain bad design.

    It should be supplied to the user function as an argument.

  • This solution fails on Unicode strings, for example "Иван Петров" should yeild "И.П", but yeilds "Ð.Ð" instead.
    To work correctly, this function needs to use runes (see my comment on the top solution for the code)

  • Nice kata;-)

  • I like the idea, but a false positive would result if a string were submitted with a literal 'x' where a digit should appear.

  • Loading more items...