Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Ok, I will try it, thank you.

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

  • This comment is hidden because it contains spoiler information about the solution

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

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

  • This comment is hidden because it contains spoiler information about the solution

  • Ah okay, thank you.

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

  • This comment is hidden because it contains spoiler information about the solution

  • 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?
  • This comment is hidden because it contains spoiler information about the solution

  • There is still a lot of information missing in the description: overview of how this encryption works, what happens when key is longer, etc... (if it's in wiki, it doesn't matter, it should be solvable without looking at it) Have a look at some other katas' descriptions to get inspiration.

    Also, try to fix the languages available. It should be as simple as editing kata, selecting latest version and hitting publish. (unless there's some conflicts)

  • So now the test should include the static keyword.

  • Okay, I will try it.

  • I still don't see static keyword in initial code, also only mono is available in language selector. You should select C# 7.3, or 8 if that's possible, and republish.

  • Loading more items...