You need to sign in or sign up before continuing.×
Ad
  • Custom 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!

  • Custom 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!

  • Custom 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!

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

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

  • Custom User Avatar
  • Custom 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!