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.
i think, this line - "for num, color in zip(range(number, number+3), (2, 1, 1)):"
should be like this - "for num, color in zip(range(number, number+3), (2, 1, 0)):"
I don't do Go at all, so I can't be of any technical help, sorry.
I've been using Go for a while. It would be cool to translate this into Go. But I've always found translations difficult to do. Usually the myself and the kata author have no idea how to do it.
If I translated it into Go, would you help me do that?
Ok, I found the reason: the random tests still pass because they don't just compare the output string against another (because several solutions may be possible), so the leading and trailing new lines, which are just about formatting, don't cause problems. The fixed tests, on the other hand, fail because the strings are different.
Thanks for ressurecting this kata, it's a pretty good one.
I don't understand the way you're handling the new lines at all. I don't see why my original code works for all but a few tests? There must be something different about those ones.
But I'll just use that last line of code you provided. Thanks again.
your code is passing with just this, tho:
return "\n".join(map(''.join,theMap))
(I just checked, both against the full test suite and the sample tests)To get it to pass, I had to do this:
So that it removes the leading and trailing '\n' for the small tests.
The last few lines of my code - which I use to return the problem in the correct format are these:
Which gives the correct format for the bulk of the problems. If I remove the leading and trailing '\n' then the first few tests pass, but the rest don't.
Hi, I've basically solved this using python. But I get kind of a formatting error with the first few tests...
The bulk of the tests seem to need a leading and trailing '\n' newline character, but the first few don't...
Sorry for the long post, but I don't know how to show this more concisely.
But then all the below cases solve no problem at all:
I really enjoyed this kata! Is the author accepting translations?
I have the crappiest solution possible. Tell me I'm wrong!
I answered my own question. It is.
Is this doable in Python in 2023?
Thank you, Davo36! The last sentence of your comment finally suggested the kind of syntax I needed to call the desired lambda from the constant list of lambdas (ACTION). That had me stuck more than any other aspect of this kata.
I really enjoyed this one. Great kata, thanks.
Loading more items...