Ad
  • Custom User Avatar

    Agree with you. The kata has been updated

  • Custom User Avatar

    Part three is officially back up! Let me know if there are any major issues though. I just re-wrote all the code to solve an issue, so if there's something I missed along the way, let me know and I'll be happy to help!

  • Default User Avatar

    OK, I'll hold off a bit then!

  • Custom User Avatar

    Haha thanks! I'm glad you liked it. I'm currently resolving some pretty ...major issues on #3. I have to start from scratch on the unit tests, and re-write most of the description to get everything up and running again. Maybe in a few days though!

  • Default User Avatar

    Thanks. With your new instructions I was able to make a slight change to my code and pass all the tests. Fun kata! Now to see whether I can complete the trilogy...

  • Custom User Avatar

    Good point. The way they are written right now, this would make the most sense. As it is written now, if a player is slotted to play first, they will lead with the first card in their hand. I did this mostly for simplicity. If player logic also decides what card the leading player plays, this adds more complexity (albiet, very slightly so) to the player logic function, which was only written to make the main focus of the kata, which is playing hands of 4 cards and evaluating each of those hands, more consistent to troubleshoot.

    I will update the description with an extra section describing what card the lead player should play.

  • Default User Avatar

    But why is Chris leading with AS in the second hand, when according to the instructions, she should have first played a point card (3H)?

  • Custom User Avatar

    You should be allowed to, if the two of clubs "2C" is not in any player's hand, and it is also the card at index 0 of the previous winner's hand,(or the first unseen card of that player's hand).

    Could you send an example of when this happens? The second test case has an example of a point card being led.

        @test.it("Players play with five cards each.")
        def test_five_cards():
            test.assert_equals(play_a_round(
                ['2C', '3C', '4C', '5C', '6C'], 
                ['AH', 'KH', 'QH', 'JH', '10H'], 
                ['AS', '3H', 'KS', 'KD', 'KC'], 
                ['2D', '3D', '4D', '5D', '6D']), ['KC', 'AS', 'QH', 'JH', '10H' ], 'Test failed when players have five cards each')
    

    Here's a breakdown of how this should play out, with (L) marking which card was led.

    • ['2C'(L), 'AH', 'KC', '2D'] -> 'KC'
    • ['3C', 'KH', 'AS'(L), '3D'] -> 'AS'
    • ['4C', 'QH', '3H'(L), '4D'] -> 'QH'
    • ['5C', 'JH'(L), 'KS', '5D'] -> 'JH'
    • ['6C', '10H'(L), 'KD', '6D'] -> '10H'

    The '3H', 'JH', and '10H' are all point cards, so maybe I need to be more descriptive of what defines a point card? Let me know if this cleared things up, or if I still need to update something in the description!

  • Default User Avatar

    It was not something I did yesterday - it was a subtle bug that was always there! Because the pieces are being placed randomly, cases of two pieces on the same square have to be removed, and I was doing it wrong. Occasionally the pieces shown on the board didn't match the real pieces. In your example, there was actually a black bishop or queen on f2, and that explains all three observations concerning the white knight move.

    I think it's fixed now. If you have the patience to continue testing, please mark as resolved if you think it is - thx!

  • Default User Avatar

    Well, that's not a fun thing to wake up to :-(. I've played through many random sequences, and never seen anything like that. I'm guessing it's a result of my change to the code yesterday. Trying to fix a bug always has a high probability of introducing a new one. I'll investigate after breakfast.

  • Default User Avatar

    Hi bdupau,

    Is it OK with you if I mark this as resolved?

  • Default User Avatar

    :-) I assumed you had solved it, since you were looking at the moves in the test code.

  • Default User Avatar

    I believe the issue is fixed, but I will let you be the judge of that!

  • Default User Avatar

    That's weird - I have a check that moves are only possible if (board[a][b] is empty or board[a][b] in enemy). Obviously, there's a bug somewhere - it might take me a little bit of time to fix it.

    Aside: Having to do random tests for this type of problem is really annoying. If somebody wants to hardcode all the fixed tests, I say let them! (It would probably be easier to increase the number of fixed tests to some seriously larger number than creating the random tests in the first place.)

  • Default User Avatar

    I'm not sure if this is quite appropriate to ask, but please give a rating if you haven't done so. It looks like it might struggle to get out of beta, as only 3 of the 6 people who have done it have submitted ratings.

  • Loading more items...