Ad
  • Custom User Avatar

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

  • Custom User Avatar

    To evolve a Pokemon you must spend a specific number of the correct Candy type, but you'll be rewarded with 500 XP and 1 extra Candy of the same type. You will also receive the evolved form of the Pokemon.

    If you need more Candy to be able to evolve a Pokemon, surplus Pokemon from that family can be transferred to Professor Willow in exchange for 1 Candy. You can't trade Candy with Professor Willow to get a Pokemon back.

    It is unclear whether freshly evolved pokemon can be exchanged for candies.

  • Custom User Avatar

    There is a fundamental flaw in the kata: the pokedex doesn't have information on what a pokemon species evolves to, but expects 3-stage evolutions to be handled, as shown by these sample tests:

    Test.assertEquals(evolveCalc({Squirtle: [1, 250], Wartortle: [1, 250]}), 1500, 'Expected 1500');
    Test.assertEquals(evolveCalc({Charmander: [2, 5], Charmeleon: [2, 5], Charizard: [437, 5]}), 3000, 'expected 3000');
    

    In general you cannot assume the evolution of a pokemon is always the one with the next pokedex No.: This is already untrue since Gen II (and Pokemon GO already goes up to Gen IV IIRC)

  • Custom User Avatar

    Kata needs to be upgraded to latest Node version.

  • Custom User Avatar

    Input param name is incorrectly named: it's an object but is named arr.

  • Custom User Avatar

    "Remember, you'll need to take into account the extra Pidgey Candy gained from tranferring and evolving Pidgeys." - First of all, there is a typo, should be "tranSferring", I guess. Second, it is unclear if you can transfer already evolved Pidgeys, thus getting not 1, but 2 candies after an evolve (if it walk like a Pidgey, then it must be a pigley - so Professor most likely will exchange them too). Third, the phrase "you won't get the Pidgey back" - is unclear, especially to not native english speakers and it would be great if it gets clarified. (do you mean that we can't exchange Candy for Pidgey?)
    Thank you.

    raising again

  • Custom User Avatar

    I'm not sure if my calculations are correct or not, and I'm not sure if the calculation method is the same as the simple version. Could you explain these testcases?

    This is your last one of basic testcase:

    mon: {"number":"007","name":"Squirtle","candy_type":"Squirtle","candy_amount":25}
    number: 1 250 amount: 25 need xps: 500
    mon: {"number":"008","name":"Wartortle","candy_type":"Squirtle","candy_amount":100}
    number: 1 250 amount: 100 need xps: 500
    ✘  Expected 1500 - Expected: 1500, instead got: 1000
    

    And these are some random tests:

    { Charmeleon: [ 24, 56 ],
     Kakuna: [ 24, 74 ],
      Charmander: [ 11, 56 ] }
    mon: {"number":"005","name":"Charmeleon","candy_type":"Charmander","candy_amount":100}
    number: 24 56 amount: 100 need xps: 0
    mon: {"number":"014","name":"Kakuna","candy_type":"Weedle","candy_amount":50}
    number: 24 74 amount: 50 need xps: 500
    mon: {"number":"004","name":"Charmander","candy_type":"Charmander","candy_amount":25}
    number: 11 56 amount: 25 need xps: 1000
    ✘  User pokemon were: {"Charmeleon":[24,56],"Kakuna":[24,74],"Charmander":[11,56]} - Expected: 2000, instead got: 1500
    
    Kakuna: [ 24, 74 ] needs 1000 XP instead of 500?
    
    
    { Dragonite: [ 21, 11 ],
      Jigglypuff: [ 4, 94 ],
      Graveler: [ 11, 33 ] }
    mon: {"number":"149","name":"Dragonite","candy_type":"Dratini","candy_amount":-1}
    number: 21 11 amount: 0 need xps: NaN
    mon: {"number":"039","name":"Jigglypuff","candy_type":"Jigglypuff","candy_amount":50}
    number: 4 94 amount: 50 need xps: 500
    mon: {"number":"075","name":"Graveler","candy_type":"Geodude","candy_amount":100}
    number: 11 33 amount: 100 need xps: 0
    ✘  User pokemon were: {"Dragonite":[21,11],"Jigglypuff":[4,94],"Graveler":[11,33]} - Expected: 0, instead got: 500
    
    Jigglypuff: [ 4, 94 ] needs 0 XP instead of 500?