Ad
  • Default User Avatar
  • Custom User Avatar

    Actually, in real Pokemon, effectiveness is not always mirrored. In fact, even hitting the same type is not always guaranteed to be "not very effective".

    Your solution only works for this kata. That is perfectly fine since that is the goal of code wars. What is not fine is to make false claims about things outside of code wars.

    PS: If we were to follow the specifications of the kata exactly, all you would need is key value pairs of the super effective relationship. You can derive the not very effective relationships from that as well as from the fact that same types are always not very effective. Anything left over would fall under neutral. So your solution is not even optimized for this kata.

  • Default User Avatar

    That's will be across the test?come on!

  • Custom User Avatar

    You'r looking for :

    f(n+1) = f(n) + 2n+1

    where f(0) = 1

  • Custom User Avatar

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

  • Default User Avatar

    You should return the number once you have calculated it, that is all :).

  • Custom User Avatar

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

  • Custom User Avatar

    Actualy, in pokemon effectiveness have alway the same multiplicators, x0 x0.5 x1 x2.

    So with that kind of configuration file your types don't need to know their effectiveness on all other types :

    'fire' : {
    supp : ['grass'],
    less : ['fire', 'water']
    }

    It's easier to maintain.
    Then you need a litle function to get effectiveness. See my solution ;p