Ad
  • Custom User Avatar

    Java fork, please review:

    • move to JUnit 5
    • change the imports
    • annotate tests with @DisplayName and @Order
    • remove a System.out.println leftover
  • Custom User Avatar

    Python: Random tests are vulnerable to input modification

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Default User Avatar

    Inconsistent position input format (in typescript), i.e. most tests have [x, y] format, last one has [y, x]. I'm not going to implement anything to work around this discrepancy.

  • Default User Avatar

    To find out if 3rd parameter (the upper limit) is inclusive or not, check the tests, it differs in each translation

    this is not OK, translations should enforce the same specifications. It seems that Ruby and Shell are inclusive while Java, JavaScript and Python are exclusive. Shell is the original language

  • Default User Avatar

    Print all numbers

    the kata does not involve printing anything to the console. this will mislead beginners. This is probably due to the fact that Shell is the original language; there should be specific instructions for Shell and general instructions for the other languages

  • Default User Avatar

    JS fork

    • improved and hopefully clearer description
    • better error messages
    • mocha + chai
  • Custom User Avatar

    Code blocks in the Example section are broken. It's impossible to see the expected values.

  • Custom User Avatar

    The description does not specify whether the position input is in format [y,x] or [x,y]. This should be specified, and sample and fixed tests should be added which use initial positions that are not x = y (ie not [0,0] or [1,1], etc).

  • Custom User Avatar

    Description should be updated...

    the initial position of the selection cursor (top-left is (0,0)) &
    For this easy version the fighters grid layout and the initial position will always be the same in all tests, only the list of moves change.

    This says to me that for this Kata, the position input for the cursor will always be top-left, 0,0. This is now (or perhaps always was) not the case and random tests do use random starting positions. My own fault for not logging input sooner, but I spent way to long before realising that the position I was treating as co-ordinates of x,y (x being horizontal and y being vertical) where not provided as expected for random inputs.

    Having logged the input and completed the Kata, I now understand how the input line may have been intended to be understood. I'm sure I can't be the only one to have encountered this hurdle. I could take it or leave RE the input line, because if the the second quoted description line (that is obviously straight up false) wasn't there, I may well have read/understood that input line differently.

  • Custom User Avatar

    [JavaScript] Since the list of game characters and the initial position are held constant anyway, the user solution should simply accept the list of moves as the sole argument as the other two arguments are redundant and therefore an anti-pattern.

  • Custom User Avatar

    Tests with random position have to be added in all languages.

    Already done for: JS / TS / python

  • Custom User Avatar

    Java 11 shouldWorkWithRandomValues test fails, but I believe the tests are wrong.
    [, Ryu, E.Honda, Cammy]
    [Balrog, Ken, Chun Li, ]
    [Vega, , Fei Long, Balrog]
    [Blanka, Guile, , Chun Li]
    [M.Bison, Zangief, Dhalsim, Sagat]
    [Deejay, Cammy, , T.Hawk]

    Moves = [left, down, left, right, up, left, left, up, up, left, right, down, left, up, right, left, left, up, up, up, right, down, left, left, right, right]
    Start = 2;2 - Fei Long

    My result = {Vega, Blanka, Chun Li, Blanka, Vega, Balrog, Fei Long, Chun Li, E.Honda, Ryu, E.Honda, Chun Li, Ken, Ryu, E.Honda, Ryu, Cammy, T.Hawk, Sagat, Chun Li, Blanka, M.Bison, Sagat, Dhalsim, Sagat, M.Bison}

    Error: ! arrays first differed at element [17]; expected:<[Cammy]> but was:<[T.Hawk]>

    Move 16 - Moved LEFT from (0;1 - Ryu) Selected: Cammy -> This is supposedly correct and up until this has been correct
    Move 17 - Moved UP from (0;3 - Cammy) Selected: T.Hawk -> Moving UP (moving between rows) from 0;3 (Cammy) leads to 5;3 (T-Hawk)

    EDIT: Apparently the problem is that you should stop if you're trying to go down from the last row or if you're trying to go up from the first row. Not like goinf left or right, wherein the cursor "teleports" to the other side and keeps going.
    So in the example roster (in the description), if you go UP from Ryu, you stay on Ryu. If you go DOWN from Cammy, you stay on Cammy.

  • Custom User Avatar
    Note: ./src/test/java/SolutionTest.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    

    since you're comparing arrays, use assertArrayEquals(), not assertEquals()

  • Custom User Avatar

    Shell translation:

    • lacks random tests
    • lacks essential fixed tests: ie. Python's first test case is [2,4,40]; this is not included in the Shell translation, allowing incorrect solutions to pass (and even be the top-voted solution for best practice)
  • Loading more items...