Ad
  • Custom User Avatar

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

  • Custom User Avatar

    You cast the result to string anyway, isn't using modulo (6 times) more expensive in this case?

  • Custom User Avatar

    If they even reach your code...

    [eval]:35
     else x=randint(0,10**randint(1,9));
                                  ^
    SyntaxError: Unexpected token (
        at Object. ([eval]-wrapper:6:22)
        at 
        at evalScript (node.js:536:25)
        at startup (node.js:80:7)
        at node.js:906:3
    
  • Custom User Avatar

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

  • Custom User Avatar

    Another problem with not returning this arises, when you try to check whether your created object is an instance of NameMe or not.

    var person = new NameMe('John', 'Doe');
    person instanceof NameMe; // false, if you return a new object, which this solution does.
    

    :)

  • Custom User Avatar

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

  • Custom User Avatar

    Changed the code template, now is properly bug fixing for every language; thanks for the feed :)

  • Default User Avatar

    Thank you rbeer for your alternative Python translation. However, I am not positive that your working solution passes all tests as when a number is passed in as a string, your program does not handle it properly according to the established Python test cases.

    May you please fix the code for the working solution so it passes all random tests every time? Once the problem is fixed I will use your Python translation as it more accurately reflects the original intent of this Kata.

    Cheers,
    Donald

    Sidenote: Next time if you want to publish a Kata translation, you may want to click on the "plus" sign on the language selection bar and do it the official way - this way, you will gain honor every time a Kata translation is approved ;)

  • Custom User Avatar

    My pleasure; for everything you might deem me useful with, feel free to contact me on our gitter channel or, if you wish, I can give you my private email :)

  • Custom User Avatar

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

  • Default User Avatar

    Thanks for the feedback ecolban, I forgot to consider division by zero when making this Kata but for simplicity I think we may assume that both a and b are non-zero provided both of them are valid numbers.

    I will make sure to consider corner cases in my future Katas :)

  • Default User Avatar

    Thanks a lot GiacomoSorbi, I will utilize them in my future Katas.

  • Default User Avatar

    Description updated. Objective should now be clear in every approved language.

    Issue resolved.

  • Default User Avatar

    Hello rbeer,

    That is true; only the Javascript version of this Kata is bug fixing, in both Python and Ruby you pretty much have to code it from scratch because they are approved translations created by other users who have contributed to this Kata.

    However, instead of changing the exercise itself (Python/Ruby version) maybe I will simply edit the description to make it clearer what is expected in each language.

    Thank you for your feedback.

    Cheers,
    donaldsebleung

  • Custom User Avatar

    Oh, I am just a mere amateur with a lot of persistence and really a lot more still to learn, trust me that I am not that big, particularly compared to other top rankers which I deeply respect ^^'.

    Anyway, both Test.describe and Test.it work in the same way, meaning they group tests (which in itself is quite useful, so you can try and possibly miss a few of them in a single click instead of stopping execution at the first error - i.e.: you get something like "12 tests passed, 3 errors").

    describe is usually the "father", having under him 1 or more .it. Their syntax is quite simple, like:
    Test.describe(*message*, testFunction).

    In plain JS syntax, you would write something like:

    *all your tests here*
    })```
    
    With more "modern" JS, currently already supported by CW, you can go for arrow notation, so the above becomes:
    ```Test.describe("Basic tests",_=>{
    *all your tests here*
    })```
    
    Hope this helps, let me know if not or if I can support you some more to the extend of my meager skills :)
    
  • Loading more items...