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.
@BlindBasics https://docs.codewars.com/community/rules
"Rules
Be considerate. Codewars may have "war" in the name but it is actually a respectful and polite community. You will be interacting with users from across the globe, who have different personal opinions and come from different backgrounds and cultures. We are all here for the same thing, to learn and improve. The Codewars community has developers of all skill levels actively participating on the site and in discussions. If you are an experienced programmer, remember that others may not be. We are all learning, we just may be at different stages in that process."
https://www.codewars.com/kata/551f23362ff852e2ab000037/python
I'm not sure if I understand your objection to using lists rather than tuples. Could you take a look at "Pyramid Slide Down", see link above, and let me know why that kata, which uses lists, is ok, while mine is not. I'd appreciate if you could explain clearly rather than by righteous indignation or scorn. This is my first attempt at authoring a kata, so I would appreciate supportive and clear advice rather than sarcasm (see for example BlindBasic's comment).
They are.
Aren't tuples one of the most fundamental basics to learn about in Python??
Arguments and output should be tuples and not lists. From authoring guidelines:
Note to the author: Don't close an issue unless it has been fixed.
Errrr.... seriously? :o
Personally I think using Python lists is ok for this. I think it will make the kata more approachable for students and Python beginners, which is my intended audiance with this kata.
Thanks for these comments. I have followed your suggestions and edited the kata.
I've looked at the Codewars documentation, and uploading images is not encouraged. However, I agree that an image would be useful, so I'll work on an ASCII art diagram.
Thanks for this comment. I've edited the description to explicitly state to round down. I've also edited the tests.
yeah you're right,
tuple
would be preferrable.Using a dataclass or a namedtuple would be nice for lisibility but maybe too heavy indeed
A tuple is fine for this, a class would be really too heavy. Classes are suited when you have custom stuff provided like methods, or when you need mutable properties, not just a fixed number of ordered fields (at most,
namedtuples
, but it wouldn't bring much value; this structure is very uncommon on Codewars). If users want to use a class, let them do it on their own, but I am sure most wouldn't find any convenvience with it.The point are not changing, thus there should be immutable tuples.
The return type should also be a tuple.
Maybe even considering having a Point class to make things fancier
Hi,
test.expect
=> don't do that, unless you provide a meaningful assertion message (whcih makes one realize that assert_equals is the tool one needs)Cheers
The text is not really intuitive on what you want exactly, a illustration image woud help a lot to understand what is going on.