Ad
  • Custom User Avatar

    It's very difficult, and in many languages not really possible to be done reliably. Kata which attempt such restrictions usually end up being very poor at enforcing them. The best approach is to avoid such requirements. There is no good, reliable way to test against them.

  • Custom User Avatar

    I'm about to publish my first kata, but I'd like to restrict the usage of certain operators & statements. How do I do this?

  • Custom User Avatar

    It says SELECT INTO is "not allowed here". How else would I assign the SELECT result to a table? I have no idea. Any advice is appreciated.

  • Custom User Avatar

    This does not classify as an issue with the kata. This is an issue with your own code.

  • Custom User Avatar

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

  • Custom User Avatar

    unsigned long long int doesn't seem to be a large enough type for one of the tests in the C translation. One of my tests overflowed or truncated, and I cannot seem to find a way around this given that the return type is fixed. Any suggestions?

  • Custom User Avatar

    I get a segmentation fault when I try to alter the 'arr' argument to change the directions. Are we expected to return a different vector?

  • Default User Avatar

    Thanks for your post and good luck with C:-)

  • Custom User Avatar

    Understandable. I suppose I should've tested it more vigorously on my system, as I got the altered result when I did several tests in a row. I will write a template that'll help me test katas on my system more readily in the future. Apologies for the inconvenience and thank you for the help!

  • Default User Avatar

    Morality of the story: don't post issues too fast:-) It tooks me time to examine your solution:-(

  • Custom User Avatar

    Oh, how embarrassing. All figured out, thank you for the guidance. Please ignore me! I need to study more on stack & heap memory, I reckon...

  • Default User Avatar

    but if the st passed is "Lagon,Lily", and my function simply processes the given arguments, how could "Elizabeth" even be a possible result of the function

    Print your array "names" before your return. When I do that in your solution I get "Lily", "Elizabeth" and your return is ofc Elizabeth...

    it returns "Lagon" on my own system when given the exact same arguments

    Try on your system not only that test but several tests in a row and you will see. Or add this test

    {
        char* st = "Lagon,Lily";
        int we[2] = {1, 5};
        dotest(st, we, 2, 2, "Lagon");
    }
    

    at the end of the "Sample Tests". Your answer will anew be Elizabeth.

  • Custom User Avatar

    Granted, but if the st passed is "Lagon,Lily", and my function simply processes the given arguments, how could "Elizabeth" even be a possible result of the function? As I said, it returns "Lagon" on my own system when given the exact same arguments.

  • Default User Avatar

    I'm trying to solve this with python and I am getting the following:
    STDERR
    Traceback (most recent call last):
    File "main.py", line 85, in
    randomTests()
    File "main.py", line 83, in randomTests
    Test.assert_equals(rank(st, we, k), rankSol(st, we, k))
    File "main.py", line 52, in rankSol
    res.append([f[i], we[i] * scoreSol(f[i])])
    IndexError: list index out of range

    I know list index out of range is usually from calling an out of range index value on a list, like lista = [0, 1, 2] and then I try and run lista[3] but I am not really sure where this could be happening in my code. Any thoughts are appreciated!

    Thanks!

  • Default User Avatar

    Expected Lagon, but got Elizabeth.

    You returned Elizabeth.

    I think there may be an issue with the testing.

    As far as I know there is no problem in the testing since 67 guys passed the C kata. Moreover I tried a few solution and all worked fine.

    Update:
    You should read https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution.

  • Loading more items...