Ad
  • Custom User Avatar

    Yea, but it has shown error in line 106? Right? I have only about 20 lines at all. That's why I don't understand..

  • Custom User Avatar

    Hi,

    you surely forgot to open or more probably to close some other parentheses, squared or curly brackets somewhere eralier (funny part being: you have to spot it by yourself... x) )

  • Custom User Avatar

    Hi, Guys! I am newbie to JS, so, please, don't judge me harsh, I got such an error (see below), when I was testing my solution for this kata here.
    Can you please, give me, right direction... what is it about? Thank you.

    /home/codewarrior/index.js:106
    });
    ^

    SyntaxError: Unexpected token )
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at [eval]:1:1

  • Default User Avatar

    That is sad to hear, you are very close. But keep in mind that the kata is not about which numbers, just that a number is found.

    Edit: nvm, be aware of duplicates

  • Custom User Avatar

    Yeah, I see now, it was my fault, I take samples for my own testing inside IDE and didn't pay attention for assert properties. Thanks.

  • Custom User Avatar

    Order shouldn't matter, that's why the test is like this:

    Test.assert_equals(get_pins(pin).sort, result.sort)
    

    I've tried returning ["11", "12", "14", "21", "22", "24", "41", "42", "44"] for "11" and it works.

  • Custom User Avatar

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

  • Custom User Avatar

    It was my bug, sorry. Everything works ok, except the ambiguity about years range. Thank you.

  • Default User Avatar

    I have a strange mistake there in last test

    Can you be more specific? Thanks, suic

  • Custom User Avatar

    Hi, in Ruby's description also mention that years are in range 1583 - 4000! As far as I understood it's not true? I have a strange mistake there in last test, but all other tests did perfectly. Could you check it, please?

  • Default User Avatar

    This is wrong solution, but it goes through all tests!

  • Default User Avatar

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

  • Custom User Avatar

    mmh, I forgot about that subtlety. You didn't pay enough attention to this requirement:

    You only count each defeated enemy once, even if it is hit by more than one laser.

    (edit: seems I'm a little late... x) )

  • Default User Avatar

    You are right! Thank you!

  • Custom User Avatar

    And there's 2 Bs and Ds on the map, and they're both hit, so it's all correct.

  • Loading more items...