Ad
  • Custom User Avatar

    Thanks for the suggestion, I changed the code of the sample tests and tests accordingly

  • Custom User Avatar

    Thanks, that was helpful.
    Help section says

    It is possible for the kata description to be updated on the kata itself, after you have updated the description here. When this happens, if there are merge conflicts an additional fork will need to be made to merge the differences together.

    so the fork should do the trick

  • Custom User Avatar

    actually i don't know about when and why merge conflicts occur, so i do not really know
    where to look for what kind of error and what i need to do to reproduce the merge conflict.
    google gave me
    https://github.com/Codewars/codewars.com/issues/1949
    so i forked the translation

  • Custom User Avatar

    The tests in the java-version does not use assertEquals correctly. When checking the number of groups, it does
    assertEquals("found too many or too few groups.", m.groupCount(), 3);
    but Syntax of assertEquals is

    assertEquals (<text>,<expected>, <actual>)

    so it needs to be
    assertEquals("found too many or too few groups.",3, m.groupCount());

  • Custom User Avatar

    Thanks for reviewing.

    • added the type
    • brackets were kind of stuck in my head because i did the Julia-Solution before translating.
      I changed them to braces which is of course much more java-esque.
      -good hint with the internal solution, didn't think about people probing for it. I made it private
  • Custom User Avatar

    Great Kata. Everybody should be able to try this, so I kumited a
    Java translation.
    Please review and approve.

  • Custom User Avatar

    Java translation kumited, please review and approve.

  • Custom User Avatar

    Java translation kumited. Please review and approve.

  • Custom User Avatar

    The signature has been fixed some time ago. I added some sample test cases and random tests as well.

  • Custom User Avatar

    I published a java translation of this,please review an approve.

  • Custom User Avatar

    Forked and corrected, the "merge conflict" does no longer show up. I don't have experience with that kind of errors, i hope i did it the right way

  • Custom User Avatar

    In my opinion, the actual description is clear and logical and I have the impression it is what was intended with the task.
    Finding a clear and logical explanation for (won,lost) = (0..2,0..1) seems a lot more fuzzy to me, so to me it seems to be
    more logical to adjust the test data to the actual description/intention.

    As ((1,0),(0,1)) is just a subset of ( rand(0..2),rand(0..1) ), which is the actual test setup, I would expect all valid solutions to still be
    valid. But that is of course up to be discussed among people more able and saner than me....

  • Custom User Avatar

    Thanks !

    To produce something with only tupels of (won,lost) = (1,0) | (0,1) something along the lines of

    750.times do
      w=rand(2)
      fighters.insert(name: names.sample,
        won: w,  lost: w==1 ? 0 : 1,
        move_id: Faker::Base::rand_in_range(1, 8))
    end
    

    should do the trick

  • Custom User Avatar

    Stupid me, it's of course "records". As i said, not native.

    But even as I'm clearly linguistically changelled here, I still can't see how

    Each row of the table fighters records...whether they won (1) or lost (0),..

    and

    If they had fought 10 matches, they'd have ten records. If they won 7 of them, 7 of the records would have a 1 in the win column, and 3 of the records would have a 0 in the win column.

    fits to data like

    id  name    won  lost  move_id    
    1  Balrog   2     2     30     
    2  Balrog   2     0     30   
    

    (SELECT * FROM fighters WHERE won>1 OR lost>1)

    To me the description and example reads like
    ONE row/record = result of ONE fight = ( won=1 and lost=0) (exclusive) or (won=0 and lost=1); no ties possible
    but the data implies
    ONE row/record = results of SEVERAL fights, giving counts of won and lost fights that were ended with the same move.
    or
    ONE row/record = result of ONE fight, where 0 is logical false and non-0 is logical true. Ties possible

    So how is it meant to be ?

  • Custom User Avatar

    Basically a nice Kata, but your database does not match your descritpion (or the other way round)
    Description says

    Each row of the table fighters records, alongside the fighter's name, whether they won (1) or lost (0), as well as the type of move that ended the bout.

    So one would expect (won,lost) = (1,0) or (0,1) whereas in your database you use values > 1 and there are (a lot of) rows where won AND lost are >0.

    And by the way: im not a native speaker, but im quite sure that the quoted sentence lacks a verb.

  • Loading more items...