Ad
  • Custom User Avatar
  • Custom User Avatar

    what about 1? It's late at night here and I'm a bit dizzy, but still I dare to say that 1 * 11 = 11 and that matches ? * 11 = ?? when ? is 1.

  • Custom User Avatar

    I agree: as a one liner, it is really neat and clever, but "Best Practices"? Low readability, low maintainability and low performance due calling lower and split functions for the two parameters in every iteration.

  • Custom User Avatar

    Well, English is not my mother tongue... and what it's even worse: I'm stupid.

    So, forget about that.

  • Custom User Avatar

    Hey Blind! I can always count on you... thanks!

    The problem is that these tests aren't even using assert_equals. Take a look at the "Show Test Cases" here, I just copied and paste that code. It calls test.expect(...).

    Nonetheless, I was doing things as you, the problem is that I commited a mistake when copying a test case and I've wasted a lot of time until I realize that. The best way to avoid this would be if I could just copy and paste the testing code published here straight forward as is.

  • Custom User Avatar

    Either the description is incomplete, or this test case in Python is wrong:

    Test.assert_equals(title_case('THE WIND IN THE WILLOWS', 'The In'), 'The Wind in the Willows')

    According to the description, it should be:

    Test.assert_equals(title_case('THE WIND IN THE WILLOWS', 'The In'), 'the Wind in the Willows')

    shouldn't it?

  • Custom User Avatar

    Hey, a question about the test cases used here for python. I'm using Python 3, so maybe the problem is related to that, but when I just copy and paste these tests on my IntelliJ Idea I got "Unresolved reference 'test'" everywhere.

    I used to adapt those test cases to unittest.TestCase class, but with this very same Kata I've wasted a lot of time trying to debug an actually working code just because I commit a mistake when adapting the testcase, so I'd like to be able to use these tests as they are to avoid these problems in the future.

    Thanks a lot in advance!

  • Custom User Avatar

    I solved that Blind4Basics, but guess what: now I've another problem that I'm sure it is related to the infinite thing you pointed before. I hope to find some more time later to address this problem and settle it today.

    Thank you very much for your help.

  • Custom User Avatar

    Hey Blind, I've just figured out my mistake a few seconds ago. It seems that I'm actually the one who's BLIND FOR BASICS things on kata descriptions... ;)

    I'm going to address this now. Thank you both!

  • Custom User Avatar

    @gotan Thanks for your answer too, but I understand it is at odds with the problem description:

    Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
    ...
    Any live cell with two or three live neighbours lives on to the next generation.

    Or may I've skipped something else?

    UPDATE: OK, I just realize I'm a functional illiterate... the point is on "ANY LIVE CELL with"... and in this case that cell is not already alive, so that rule doesn't apply to it. I think you're right. Thanks a lot!

  • Custom User Avatar

    @Blind4Basics Hi fellow! do you live inside here like Neo? ;)

    I actually considered that, so I've screwed it up probably somewhere else.

  • Custom User Avatar

    I don't understand the default one-generation only test. I know it is not wrong because nobody has complained before, so I'm probably missunderstanding something. Let:

        start = [[1, 0, 0],
                 [0, 1, 1],
                 [1, 1, 0]]
    

    And expects:

        end = [[0, 1, 0],
               [0, 0, 1],
               [1, 1, 1]]
    

    But I think the first row should be [0,1,1] instead (and thus my code "thinks" the same...), because the top-right cell and its neighbors at the start are:

                     0, 0],
                     1, 1],
    

    So it has 2 alive neighbours, and according to the description of the problem, by having two alive neighbors the top-right cell should turn alive too.

    What am I missing here?

    Thanks in advance!

  • Custom User Avatar

    Ah! so you write pythonized Java code! :D

    I do the opposite usually, and write javatized Python code. However, here I've already written a couple of abhorrent one-liner Python solutions, just for the sake of not being a freak. ;)

  • Custom User Avatar

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

  • Custom User Avatar

    This is probably significatively more efficient that dealing with strings and chars.

  • Loading more items...