Ad
  • Custom User Avatar

    I know this is an old fork to an even older translation, but I will list issues and reject, anyone wanting to fix can do so on a fork.

    • New test framework should be used
    • Since JS allows **, probably Python should allow it too
    • Anticheat is very very weak. It doesnt even prevent from math import pow. For an 8kyu it doesnt need to be overly strong, but at least the basic ways of importing math should be blocked
  • Custom User Avatar

    First of all, I was the one to answer you earlier about prohibitting **, so I know it's your first translation. Secondly, after you said you were translating I sent a follow-up message about a PROPER anti-cheat which also prohibits the use of pow. Thirdly, I'm giving you a chance. I'm giving you a chance and I'll gladly approve this translation if you at least add random tests like this:

    @test.describe("Random tests")
    def random_tests():
      from random import randint
      a = randint(MINIMUM, MAXIMUM)    # MINIMUM and MAXIMUM are some numbers of your choice
      b = randint(MINIMUM, MAXIMUM)    # don't make "b" go below 0 as it is unhandled in this kata
      Test.assert_equals(power(a, b), a**b)
    
  • Custom User Avatar

    If you have a problem with it, please fork it instead of leaving unmotivating and non-constructive comments. It is really just unnecessary.
    And for your information, this is my first translation and no one ( Including myself) expects it to be perfect.

  • Custom User Avatar

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

  • Custom User Avatar

    This one seems easier than this other kata that disallows that operator: https://www.codewars.com/kata/power/train/javascript

  • Custom User Avatar

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

  • Custom User Avatar

    The translation is just as bad as the kata is (it was approved by ZED? Unbelievable).

    There're no random tests and the anticheat makes no difference (it's even worse than in JS as you can simply power = pow)...

  • Custom User Avatar

    Put the following code in the Preloaded section:

    with open("/home/codewarrior/solution.txt", "r") as file:
        f = file.read()
        
        import re
        forbidden = re.findall(r'|'.join(map(r"\b{}\b".format, [
        "**",
        "pow",
        "ipow",
        "open",
        "builtins",
        "__getattribute__",
        "eval",
        "exec",
        "globals"])), f)
        Test.assert_equals(forbidden, [], "Using forbidden commands")
    

    I'm not sure if this will be sufficient, but it blocks the most obvious ways to raise n to the power of m and acts as an ok anticheat.

  • Custom User Avatar

    By the way, please be patient when asking for help.

    Be patient. This mostly applies to forums, mailing lists, and code contributions (i.e. asynchronous forms of communication). It is possible that your question or code contribution or suggestion might not receive an immediate response. Be patient and consider the norms of the community. One reminder ping is welcome, many reminder pings in rapid succession are not a good display of patience. Similarly, posting the same question in multiple threads is frowned upon and should not be done.

    Codewars Community Code of Conduct

    If you're having a problem with a kata, ask questions and move on to another one. Don't expect immediate responses because they're just regular users like yourself. They're in different time zones, may not have time during weekdays, etc.

    If your issue is about Codewars itself, then open an issue on GitHub so that we can look into the problem.

  • Custom User Avatar

    How to find out what is gitter:
    step 1: open google and search for "codewars gitter"
    step 2: ???
    step 3: profit

    There's no real way to get in touch with other user if you don't have their e-mail/skype - only through discourse or gitter.

  • Custom User Avatar

    Python translation submitted :)

  • Custom User Avatar

    I'm actually just trying to translate one.
    But thanks!

  • Custom User Avatar

    (You're asking in a wrong thread, it's feature requests, not content/site design)

    By parsing the solution like this:

    with open("/home/codewarrior/solution.txt", "r") as file:
        f = file.read()
        Test.assert_equals("**" in f, False, "You can't use '**'")
    

    but this snippet will absolutely NOT suffice as an anticheat, and you'll have to ban other ways to raise a number to the power of n.

    Apart from that, it's highly probable that you're working on a duplicate, so browse the katas before publishing anything.

  • Custom User Avatar

    @Phil157

    I didn't even know that Donald was a moderator and what is gitter?

    Moderator is just another name for power users with more privileges (high honor points). He also maintains the Fortran test framework used on Codewars.

    Gitter is a chat service where you can talk to other users. You can join at https://gitter.im/Codewars/codewars.com

  • Custom User Avatar

    How do I disable ** in python for a kata?
    Thanks!