Ad
  • Custom User Avatar

    probably relates to specific language(s). js works, tried just now

  • Custom User Avatar

    Not a bug, and you shouldn't mutate the input.

  • Default User Avatar

    Always this same bug at CW, you write it rigth and CW saves it wrong.
    I re-published it and it works now.

  • Custom User Avatar

    TypeScript, error on example tests execution:

    ../home/codewarrior/spec.ts(1,1): error TS1084: Invalid 'reference' directive syntax.
    ../home/codewarrior/spec.ts(2,1): error TS1084: Invalid 'reference' directive syntax.
    

    because this

    /// <reference path="/runner/typings/main/ambient/mocha/index.d.ts" >
    /// <reference path="/runner/typings/main/ambient/chai/index.d.ts" >
    

    should be like

    /// <reference path="/runner/typings/main/ambient/mocha/index.d.ts" />
    /// <reference path="/runner/typings/main/ambient/chai/index.d.ts" />
    

    i.e. references are lacking slash before right angle bracket

    after this edit code compiles and example tests pass

    this should probably be corrected in main spec, because on attempt to run all tests the same error is returned

    ../home/codewarrior/spec.ts(1,1): error TS1084: Invalid 'reference' directive syntax.
    ../home/codewarrior/spec.ts(2,1): error TS1084: Invalid 'reference' directive syntax.
    
  • Custom User Avatar

    Interestingly, this is relevant to TypeScript version of the Kata and not relevant to its JavaScript version. Discovered it just now, after translating my JS solution to TS. In JS version I am mutating position. Mutating position in TS version results in random tests failure. After copying it to temp variable and using it, the test passed with the same logic.

  • Custom User Avatar

    For some reason after getting a correct answer, starting from the 2nd test case, the function loop_size is called again. Despite this fact the kata is solvable. I managed to override this probable bug by using global scope in addition to local.

  • Custom User Avatar

    I have a problem in JavaScript

    second test:

    if i return 0:
    log 0
    Expected 23 got 0
    log 0
    (not passed)

    if i return loop size:
    log 23
    log 0
    (not passed)

    tests starting from the second call function twice
    first time the returned value is correct, but function is called the second time and returned value becomes 0 and test doesnt get passed.

  • Custom User Avatar

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