Draft

Witches, Goblins, and Spiders

9 of 10NonBrewed
Description
Loading description...
Fundamentals
Algebra
  • Please sign in or sign up to leave a comment.
  • Madjosz Avatar

    For the test case n_goblins=9, n_spiders=8 I see many different implementations:

    • one says: 8 or more spiders -> convert all goblins to Spidy-Gobs -> resulting power is 72
    • another: 8 or more spiders -> turn only as many goblins to Spidy-Gobs as we have spiders, ignore the rest -> resulting power is 64
    • third: 8 or more spiders -> turn only as many goblins to Spidy-Gobs as we have spiders, take the rest normal goblins -> resulting power is 65

    For some reason all of these 3 iterpretations pass the tests.

    EDIT: Well, that was easy...

    answer = optimal_battle_strategy(number_goblins, number_spiders)
    test.assert_equals(optimal_battle_strategy(number_goblins, number_spiders), answer)
    
  • dolamroth Avatar
    • Why all spiders are not counted, if used as multiplier? Only a subset of spiders should be used as multiplier?
    • Why condition about minimum of 8 spiders?
    • It is not explicitly mentioned, that base power of all units is the same. You have to operate in numbers, if the end task is in numbers.
  • hobovsky Avatar

    I don't understand this: "In order to turn into a Spidy-Gob, there needs to be a minimum of 8 spiders". Does it mean that to turn into a monstrous spidy-gob:

    • a goblin has to put at least eight spiders on its head, or maybe
    • there needs to be at least eight spiders in the whole team, but it's enough to put a single spider on a goblin's head?

    BTW I love the theme, spidy-gobs are scary as hell!

  • Voile Avatar

    Missing test case of something like 2, 20 (where not creating Spidy-Gobs is actually more optimal).

  • ejini战神 Avatar
    • JS is obsolete and should be deleted

    Python:

    • No random tests

    • Initial solution setup is wrong

    • No example tests

    • Description does not explain the order of the parameters given

    • Voile Avatar

      Initial solution setup is wrong

      It's not just wrong, it's missing.

    • NonBrewed Avatar

      I believe I fixed everything except for the random tests, wasn't sure how to add those. I tried going to discord for help and couldn't type anything in because it wanted me to confirm my account and said my email already exists.

    • Just4FunCoder Avatar

      This comment has been hidden.

    • Just4FunCoder Avatar

      Initial solution setup: Parameter name should be in snake case, so n_goblins, n_spiders instead of nGoblins, nSpiders.

    • NonBrewed Avatar

      Ok, second update through. I don't think my "random" tests are so random. The only way I found to test it was running the random values through the function again. Of course the answer will equal whatever those values are.

    • NonBrewed Avatar

      added

      Issue marked resolved by NonBrewed 3 years ago