Ad
  • Custom User Avatar

    sounds like the assertions are still reversed... Weird... :/

    Even if I don't do C#, I can tell you that this is a pretty bad design, for what you're currently doing:

        private static readonly Dictionary<string, int> _register = new Dictionary<string, int>();`
        ^^^^^^^^^^^^^^
    

    That's a global variable, and you don't use it correctly, afaik.

    So now, since you still don't provide all the info... I just can tell you this:

    • print to the console your result just before the return statement, to be sure about what is your output, compared to what is told in the assertion message (goal: see if actual and expected are swapped or not)
    • I bet the C# framework works the same than the Java one, so several tests are run in the same method, and if you print the input arrays only, withtout any separations, you'll take several inputs for one only. And I'tend to bet that's what you currently do. => print stuff like "-----" at the beginning of your function, to be sure the data you use for debugging is trustable.

    good luck. ;)

  • Custom User Avatar

    here is what I get in python: {'a': 1, 'b': 0, 'c': 0, 'd': 1}
    Seems the C# ref solution is expecting the very same (kind of not sure about the registers names, since I don't do C# myself, but I'm sure there are 4 values and that there are 1,0,0,1... x) )

  • Custom User Avatar

    First things first: if you wanna get help, you need to be precise about the problem you're facing. Here you're always giving only half (if not less) of all the useful information.

    See the generic message below (it's about the Issue/Question flags, but you'll see there all the required stuff in order we can track the thing):


    Seems you're "rather new" to cw, so here are some general guidelines about the comments:

    • 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.


    I'll try your input program in a sec...

    " 'later"

  • Custom User Avatar

    That's what I thought: expected and actual were swapped in the random tests. So your code is the wrong one, returning the a,b,c stuff.

    I updated the tests.

  • Custom User Avatar

    Hi,

    1. Always state the language you're using ( -> C# )
    2. plz check that expected and actual aren't swapped => print your output to the console to verify that "your result" isn't actually the one of the reference solution
    3. are you mutating the inputs at some point?