Ad
  • Custom User Avatar

    C Translation (author inactive).

  • Custom User Avatar

    -- Java version of the kata --

    The kata details state that inputs are not sorted. My tests have shown that at least one of the successfully submitted solutions is not correct.
    This would be detected if a test was added for the following input (expected result: 3):
    new int[][] {{10, 11}, {1, 8}, {6, 9}, {5, 7}})

    I have a general question (sorry if it is not an appropriate forum, I am new here)

    • Adding sort to existing solutions will make them correct, but also will affect performance, so some of them might no longer be viable... Would a new test somehow invalidate solutions that are already submitted?
  • Custom User Avatar

    Haskell translation

    The description has been updated, adding a primer on generating random numbers, as it's a bit more advanced for Haskell than for other languages.

  • Custom User Avatar

    JavaScripts tests are vulnerable to (possibly accidental) redefinition of the fighter class.
    fixed here along with:

    • better assertion messages
    • using a modern JS class for the Fighters
  • Custom User Avatar

    UPDATED GROOVY TRANSLATION

    Changes:

    • Using junit jupiter instead of plain junit and Groovy's built-in assert for testing
    • Using the org.junit.jupiter.api.Order annotation
    • Fixed the problem where fighter1.name would equal fighter2.name in the random test cases
    • Other small changes
  • Custom User Avatar
  • Custom User Avatar

    JS:

    • mocha + chai framework should be used

    • perhaps also assert.deepEqual instead of wasting CPU computation for individual assertions. Imagine if this were a Unit Testing for banking system software, it would have caused havoc upon release to the public...

  • Custom User Avatar

    Description is a total cluster F***, everything should be generalized and made language-agnostic

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    I'm having trouble completing this KATA in Clojure. The description says a third argument will be passed with the name of the first attacker, but the argument is not present.

    I assumed Fighter 1 will aways attack first, but several random tests fail. The same happens if I default Fighter 2 to attack first.

  • Custom User Avatar

    C#: method name should be PascalCase (Please refer to implementation of backward compatibility here )

  • Custom User Avatar

    Sorry... but in C++ the kata has to be redesigned, as is it is a sound example of BAD C translation to C++
    I don't raise an issue but...

    Codewars is a learning platform

    a) use std::unique_ptr if you want to use pointers..
    b) but could be better to use refs (Fighter &fighter1) in the call to 'declare_winner' . This would allow to use exactely the kind of prototype stated in the details:

    declare_winner(Fighter("Lew", 10, 2), Fighter("Harry", 5, 4), "Lew")
    

    instead of using naked pointers..
    c) all pseudo "hidden" parms of Fighter class have setters and getters which is (generally) a bad practice in C++.
    d) setHealth() ? should be transformed in "receiveDamage()" returning bool (true) if the fighter is still alive.

  • Custom User Avatar

    sorry if this question is dumb but ive been trying to search for what the 'this.variable' in the object does/ means. in this case its this.name, this.health ect.. but im having a hard time finding an answer i understand well. can anyone explain it at all?

  • Custom User Avatar

    ( JS, possibly others )

    Not returning a value is not tested.

  • Custom User Avatar

    COBOL translation (author is inactive).

  • Loading more items...