Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
removed
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.
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.
Well, English is not my mother tongue... and what it's even worse: I'm stupid.
So, forget about that.
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.
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?
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!
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.
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!
@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!
@Blind4Basics Hi fellow! do you live inside here like Neo? ;)
I actually considered that, so I've screwed it up probably somewhere else.
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:
And expects:
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:
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!
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. ;)
This comment is hidden because it contains spoiler information about the solution
This is probably significatively more efficient that dealing with strings and chars.
Loading more items...