Ad
  • Custom User Avatar

    Rejecting this because:

    1. PHP function names should be in snake_case - this should be apparent from the way built-in PHP functions are named
    2. You didn't even bother to randomize the order of the fixed assertions in the Submit tests
  • Custom User Avatar

    Fixed

  • Custom User Avatar

    review the solution list and saw my solution again. I would to say: nice!!! ^_^

  • Custom User Avatar

    Thank you for your answer.

    So I guess this is something that should be fixed by Kata authors.

  • Custom User Avatar

    The issue is not related to Babel or "use strict" (test won't even run in strict mode).
    Testing the solution code by checkCode(arguments.callee.toString()); causes false positives like above because it's testing the solution and some internal setup code inserted by Codewars to run the test. The solution should be validated by reading /home/codewarrior/solution.txt. See How To: Read the user's solution within your test.


    'global was reassigned' is from throw new Error('global was reassigned') I added (#298) for #259.

  • Custom User Avatar

    Every time I submit my solution or even when I submit default/empty solution the test throws the error:

    Error: Strings are not allowed.
    Found 'global was reassigned'
       at dontTryAndCheat
            at Object.handleError
            at ContextifyScript.Script.runInThisContext
        at Object.exports.runInThisContext
    

    Even the following code throws the error:

    var helloWorld = function() {
    
    }
    

    Maybe the issue is that Babel transpiles the code with the string "use strict" that is being identified as "prohibited" string by the kata?

    Could you please check if this is the case?

  • Custom User Avatar

    Hi, I have just updated the description, please re-read as you were probably misunderstanding the task slightly.

    Let me know if you're still having problems. Thanks!

  • Default User Avatar

    Did you figure out where you went wrong? I'm having a similar issue...

  • Custom User Avatar

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

  • Custom User Avatar

    Hi- apologies for the delay in replying. If you fancy another crack at this I have now updated the tests to show the input if you get the wrong answer. Thanks.

  • Custom User Avatar

    Hi, apologies for the delay in responding. Please could you post your solution here? (and mark it as a spoiler). This sample output looks strange as there are multiple duplicate tests.

    Thanks

  • Custom User Avatar

    Hi. Apologies for the delay in replying- I have updated the tests so now the random inputs are displayed if you get the wrong answer. Please have another try and let me know. A few other people have been having a similar issue, I believe it is due to a misunderstanding in the description, but it is strange that it doesn't affect the 'big number' random tests.

    Thanks!

  • Custom User Avatar

    Hi. I have just updated the tests so the random inputs are shown if your answer is wrong. I put in your solution and ran the tests, and tried (by hand) one of the random ones you got wrong, and it agreed with my solution. I think you must have misunderstood the task slightly- apologies but I haven't had time to look through your logic- maybe try again now the tests are more descriptive and let me know if you still have issues?

    Thanks

  • Custom User Avatar

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

  • Custom User Avatar

    Hi, please could you write your solution in a comment here (and mark as spoiler) or send it to me in a private message? Thanks

  • Loading more items...