Ad
  • Custom User Avatar

    Less lines of code = better

    duh

  • Custom User Avatar

    completed

  • Custom User Avatar

    I did not tell you that it was better. You asked for a workaround and I gave you one. You can choose whichever option you like. I don't think it matters too much that the name is the same as the builtin, since 1) you can still use the builtin in your solution without any change and 2) this function will only ever be used for this kata, it's not going to be part of a large project where it could indeed confuse readers. If you insist on not using the same name, at least do not use PascalCase for it, as the link above specifically discourages this style for function names.

  • Custom User Avatar

    you can do this:

    import "package:solution/solution.dart" as solution;
    
    void main() {
      group("Fixed Tests", () {
        test("Test str:hello world!,  prfx:hello", () {
          expect(solution.startsWith("hello world!", "hello"), equals(true));
        });
    

    it's better than using PascalCase for the function's name, as the official Dart style guide discourages this

  • Custom User Avatar

    Python, Ruby and TS do have random tests. Do not use the translation tab as a reference, instead use the kata trainer if you want to check it accurately. Also, there is an issue mentioning the same thing , so closing this one ^^

  • Custom User Avatar

    Rejected, the current Python translation does have random tests. You are looking at a really old fork, start looking from the top which indicates a more recent translation.

  • Custom User Avatar

    why is it an issue ?

  • Custom User Avatar

    Sorry I didn't notice your replies earlier. I'm not sure what's the correct way to do this, but hopefully I'll find some time in near future to figure it out.

  • Custom User Avatar

    If you mean the translation, then, if the rank is fitting, it's probably OK. Otherwise, you shouldn't translate to a language that makes it too easy to solve. Because it is a white kata, it should be fine if you solve it that way.

    It may be possible to block using such things (I don't know about Dart specifically), but that's almost never a good idea.

  • Custom User Avatar

    Approved.

  • Custom User Avatar

    are you going to give the same comment on every kata?