Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • The signature has been fixed some time ago. I added some sample test cases and random tests as well.

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

  • 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

  • In the initial solution too.
    And there's a merge conflict. Fork and update the description.

  • 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....

  • To produce something with only tuples of (won,lost) = (1,0) | (0,1)

    Just update the description to mention the actual content of the table. No sane person will change the task because of an inaccurate explanation.

  • 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

  • I can take a look at it but honestly, I wrote this about a year ago, I was a beginner to SQl and I'm now out of practise. If the data's coming back with 2 won and 2 lost, then it must have collated them, but I don't, at this time, remember.

  • 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 ?

  • The sentence lacks nothing. If you would like to correct a native speaker with a degree in literature, then by all means show me where the missing verb is.

    I suppose I could omit the second comma, if we're being nitpicky. "Each row of the table records, alongside their name, whether they won or lost as well as the move." The informatino about the name could be removed with no effect on flow.

  • 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.

  • The message is directed at the kata's sensei....i should have marked it as "suggestion", but forgot about that

  • Loading more items...