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

  • and WTF did you resolve this issue? The typo isn't corrected. Did you even changed something to the description?

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

  • Can I transfer or evolve them? Or is both possible? Evolve as many as possible than transfer as many as possible to evolve as many as possible again...?

  • Ok, submit and passed. Thanks

  • Apologies. copy and paste error.

    Fixed.

  • 
    ReferenceError: sellEvolved is not defined
        at xyz
            at /runner/frameworks/javascript/cw-2.js:241:21
        at Promise._execute
        at Promise._resolveFromExecutor
        at new Promise
        at Object.Test.describe
                
            at Object.exports.runInThisContext
            ```
    
  • random test post error:

    ReferenceError: pokeCalc is not defined
        at xyz
            at /runner/frameworks/javascript/cw-2.js:241:21
        at Promise._execute
        at Promise._resolveFromExecutor
        at new Promise
        at Object.Test.describe
                
            at Object.exports.runInThisContext
    Completed in 4ms
    
  • Hello,
    sorry, I do not understand how it is possible to get 2500 exp from (63, 1) ?
    If you can change only 5 pidgeys, then you will get (58 pidgeys and 6 candies) in the result, so exp = 0 (there are candies less than 12, you can't evolve any pidgey).

  • Sorry for not getting back to you - had a hectic weekend.

    I've fixed a bug in my code and your solution should work for all tests now. The last example test case you posted is an old one, so you shouldn't be seeing that. May be a caching issue.

    Test cases should be:

    Test.describe("Basic Tests", function(){
      Test.assertEquals(evolveCalc({Pikachu: [3, 150]}), 1500, 'Expected 1500' );
      Test.assertEquals(evolveCalc({Pidgey: [13, 144]}), 6500, 'Expected 6500' );
      Test.assertEquals(evolveCalc({Pidgey: [13, 144], Pikachu: [3, 150]}), 8000, 'Expected 9500' );
      Test.assertEquals(evolveCalc({Vulpix: [1, 49], Ninetales: [1, 49]}), 500, 'Expected 500');
      Test.assertEquals(evolveCalc({Psyduck: [1, 40]}), 0, 'Expected 0 - Not enough candy.');
      Test.assertEquals(evolveCalc({Snorlax: [1, 130]}), 0, 'Expected 0 - Snorlax can\'t be evolved.');
      Test.assertEquals(evolveCalc({Squirtle: [1, 250], Wartortle: [1, 250]}), 1500, 'Expected 1500');
    });
    
  • And the last example testcase seems wrong:

    Test.assertEquals(evolveCalc({Pidgey: [1, 500], Pidgeotto: [1, 500]}), 1000, 'Expected 1000');
    

    evolution 1 Pidgey to Pidgeotto, need xp 500
    and then we have Pidgeotto: [2, 500]
    evolution 2 Pidgeotto to Pidgeot, need xp 1000
    So, we need total 1500 xp
    am I right?

  • I retry it, and I solved the problem of evolution, But there's more test cases that I can't understand:

    ✘  User pokemon were: {"Poliwag":[17,63],"Jolteon":[7,22],"Arbok":[23,92]} - Expected: 500, instead got: 1500
    Poliwag":[17,63] amount=25 
    I want to know: Are we able to turn 12 Poliwag into Poliwag candy?
    
    ✘  User pokemon were: {"Voltorb":[22,59],"Charmander":[13,91],"Charizard":[5,91]} - Expected: 1000, instead got: 2500
    Look at "Charmander":[13,91] its amount is 25, it at least can evolution 3 Charmander to Charmeleon, why the expect is 1000?
    
    
  • { Nidoqueen: [ 3, 62 ], Caterpie: [ 9, 22 ], Arbok: [ 23, 30 ] }
    mon: {"number":"031","name":"Nidoqueen","candy_type":"Nidoran ♀","candy_amount":-1}
    number: 3 62 amount: 0 need xps: 0
    mon: {"number":"010","name":"Caterpie","candy_type":"Caterpie","candy_amount":12}
    number: 9 22 amount: 12 need xps: 1000
    mon: {"number":"024","name":"Arbok","candy_type":"Ekans","candy_amount":-1}
    number: 23 30 amount: 0 need xps: 0
    ✘ User pokemon were: {"Nidoqueen":[3,62],"Caterpie":[9,22],"Arbok":[23,30]} - Expected: 500, instead got: 1000

    Caterpie: [ 9, 22 ] Why not 1000?

  • Yeah, you will need to adjust your calculation method slightly from the last one, to take into account the relationship between pokemon in the same family.

    The last of my basic test cases expects 1500 because you can evolve the Wartortle once, and evolve the Squirtle into a Wartortle and then again into a Blastoise. 3 evolutions = 1500 xp.

    The first random test you posted - looks like you won't ever have enough to evolve a Charmeleon so the optimal option for XP would be to transfer them to make enough candy to evolve 3 of your Charmanders. Your Kakuna value is correct, but you can get 1500 XP from your Charmanders.

    The last random test - that's a genuine error. The pokedex had a typo, so Wigglytuff wasn't being included in the Jigglypuff family. This is now fixed.

    Loved your solution for the simplified one btw!

  • Loading more items...