Ad
  • Default User Avatar

    @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."

  • Default User Avatar

    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).

  • Custom User Avatar

    They are.

  • Custom User Avatar

    I think it will make the kata more approachable for students and Python beginners

    Aren't tuples one of the most fundamental basics to learn about in Python??

  • Custom User Avatar

    Arguments and output should be tuples and not lists. From authoring guidelines:

    * Stick to rules commonly recognized for your language. Know and follow its naming conventions, coding rules, and best practices.
    * Respect widely-recognized standards and conventions related to software design and programming. Avoid antipatterns and bad practices.
    

    Note to the author: Don't close an issue unless it has been fixed.

  • Custom User Avatar

    Errrr.... seriously? :o

    • how using brackets instead of parentheses makes the task easier?
    • how is that better to show/teach bad practices?
  • Default User Avatar

    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.

  • Default User Avatar

    Thanks for these comments. I have followed your suggestions and edited the kata.

  • Default User Avatar

    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.

  • Default User Avatar

    Thanks for this comment. I've edited the description to explicitly state to round down. I've also edited the tests.

  • Custom User Avatar

    yeah you're right, tuple would be preferrable.

    Using a dataclass or a namedtuple would be nice for lisibility but maybe too heavy indeed

  • Custom User Avatar

    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.

  • Custom User Avatar

    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

  • Custom User Avatar

    Hi,

    • the description is talking about rounding, while the tests are asking for flooring
    • the example tests are writen the "old fashion way", when it comes to the use of the test framework. Better to write them like you did with the full test suite
    • I didn't check, but it looks like the fixed tests of the full test suite are different from those in the example tests. Bad idea => the full tests should at the very least contain all the example tests
    • the example tests are using 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

  • Custom User Avatar

    The text is not really intuitive on what you want exactly, a illustration image woud help a lot to understand what is going on.