Beta

Mr. White

Description
Loading description...
Puzzles
Algorithms
Recursion
View
AllIssues5Questions1SuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • monadius Avatar

    The reference solution cannot solve some cases. For example, the case [1, 2, 2, 1, 2, 4, 0, 1, 4], w = 3, l = 3 has the following solution: ['M', 'H', 'M', 'H', 'M', 'M', 'H', 'H', 'M']. But the reference solution returns ['?', '?', '?', 'H', '?', 'M', 'H', 'H', 'M'].

  • monadius Avatar

    The rule for people[i] = 0 is not explained in the description. The reference solution and all test cases assume the following rule: if people[i] = 0 then the i-th person and all neighbors of the i-th person are innocents (H). This rule does not follow from the general rule "there are at least 0 monsters adjacent to me".

    • Kacarott Avatar

      Should the 'special rule' be removed, and the description/reference solution fixed? Or should the special rule be mentioned in the description properly?

    • monadius Avatar

      I prefer to make all rules consistent and remove the special rule for 0.

  • monadius Avatar

    Random tests sometime fail with the following message:

    'Situation is paradoxical' should equal 'paradox'
    

    The reference solution in tests should return 'Situation is paradoxical'.

  • Kacarott Avatar

    I am confused by the 'paradoxical' situation that you mention. I cannot see how the people represented by 1 are not monsters.

    The input is [0, 0, 0, 1, 0, 1, 0, 0, 0] (From description). Which, in a square, looks like:

    000
    101
    000
    

    Now, since at least 0 must always be true, we can infer that all 0s are human:

    HHH
    1H1
    HHH
    

    And now, since we know all surrounding people are Human, the At least 1s must definitely be lies -> Monsters.

    HHH
    MHM
    HHH
    

    Where is the paradox? Am I missing something??

    • Mercy Madmask Avatar

      This is indeed not a paradox, just tested with my solution and it gives what you found.

    • Kacarott Avatar

      Is it simply not tested? Or how does your solution handle paradoxes (I don't quite understand how a situation can be a paradox at all.)

    • monadius Avatar

      It is a paradox if a special rule for 0 is assumed. This rule is not explained in the description (but it is hinted there). See my issue above.

  • Kacarott Avatar

    Current test set up is insufficient. You need:

    • Fixed test section (tests with a hardcoded solution. Put as many edgecases as you can think of here.)

    • Many more random tests. Ideally something like 50-100. (You can run the tests in a loop)

    Read this for info.

    • AlisaIsStillGodly Avatar

      There are 50 ish tests now, including 12 difficult fixed tests, including edge cases (so difficult I had to rewrite some code). I think it is better...

    • Kacarott Avatar

      Looks pretty good. I am not going to look too closely (since I still want to solve this properly) but I will mark as resolved and if anything else comes up later someone can raise it as a seperate issue.

      Issue marked resolved by Kacarott 4 years ago
    • AlisaIsStillGodly Avatar

      Still no one has solved the kata... do you have any idea why that is?

    • Kacarott Avatar

      Since it is in beta, a lot less people see it until it is approved. Also it is not a very easy kata, so people have to spend more time on it (meaning lots of people won't be bothered/have time).

      All you can do is fix any issues that come up, and just wait. Maybe if you go around completing some of the other beta katas that are waiting for people to solve them, it will give this one good karma ;)

    • AlisaIsStillGodly Avatar

      It's been two weeks at this point... I wonder if there is something wrong?

  • Kacarott Avatar

    Users can mutate inputs, ruining the tests. You need to send the user solution a seperate copy of the input lists than what you use in the tests. (See my solution for example.)

    You should also have some fixed tests, including some edge cases (for example the paradoxical situation)