Ad
  • Default User Avatar

    The thing is, for example the function ToIndustrial may get a string passed as argument or an int and due to the nature of C# being strong typed, usually won't let you, what it can have is function overloads and that what I tried doing, (inspired by the rust translation), what can be done to overcome this, is to change the type of the params to the base class "object", then let the user check what data type is the object, let say, if it is an int or an string, which funny enough I actually wrote the first version of the translation like that hahaha. Then again the reason why i did it this way was based on the rust translation, and thought it was good to mimic, but given that you are the original author, I will gladly change it how you want it to be so it can avoid confusions!

  • Default User Avatar

    Oh I see what you mean, sorry I will definetly change the solution so it can be done without using Linq, it will also make it clear how can be done without it!

  • Default User Avatar

    One more question: your solution is packed in a class. The kata only asks for three functions. Again, my lack of knowledge in regard to C# comes to play: if it is possible to define only simple functions, I'd prefer that over the expectations that your translation poses. Would a solution pass, that is made up of simple functions?

  • Default User Avatar

    Hello Gon-CJ,

    I've seen your translation only some moments ago, didn't yet go deeper. the first thing that catched my eye is that it seems to me, one cannot solve the C# kata without using the library 'system'. I never programmed in C#, so maybe my caveat is pointless, but I made the experience, that it is problematic, if the expected solution is based on a specific library the warriors have to use. On the other hand, you entered it in the Solution Setup.
    Nevertheless, if a solution without use of any libraries at all is possible, that would be the way to do it.
    I'm not sure whether I made my point clear... what do you think?

  • Default User Avatar

    Thanks to your comment i found about this kata, took me a good couples of minutes but i figured it out.
    Try to read it carerfully, i didn't understand why i was failing until i read the part which says that the student gains 20pts more if they have 5 courses or more with grades of B or A only. Also the part which says that the points are capped at 200, which i also forgot and was giving me false positives. Maybe rewrite the code? Anyhow, good luck!

  • Default User Avatar

    The logic of your code handles well when it compares NORTH against SOUTH or EAST against WEST (or viceversa), but doesn't when you need to go in the same direction twice in a row. Try to test for those scenarios. Example, you are given this array: |NORTH -> NORTH -> WEST -> WEST|;
    And compare how it behaves with this other array: |NORTH -> SOUTH -> EAST -> WEST|;
    Analize the outcome of both.

  • Default User Avatar

    For what I can see, you are almost done. You just have to think what will happen, let's say, for example, going north twice.

  • Default User Avatar
  • Custom User Avatar

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

  • Default User Avatar

    Really nice Kata, made me happy to be able to understad the Aggregate function in C# with it, i will see if i can do the same with JavaScript eventually!