Ad
  • Custom User Avatar
  • Custom User Avatar

    damn you all are smart. I completed this in 6 lines of code.

  • Custom User Avatar

    I used this method :)

  • Custom User Avatar

    clarified

  • Custom User Avatar

    (C) may I suggest precluding the use of strchr, strspn, strtok_r and so on?

  • Custom User Avatar

    Ideally, all positions need to be clear about the previous move. But, as we both agree that previous position matters for en passant cases only, for tesing purposes you can ommit it if it's not en passant situation as it does not matter what piece made the last move. If you worried about getting an error while reading the previous position, use an error free reading option. Not sure what language you are using, but Python has one.

    Another thing that's not perfect: I encountered one test that is not correct: a king is under a check, but a move belongs to the other player. I provided details in my other post below.

  • Custom User Avatar

    Correct, I believe my comment was not clear. What I meant is that the previous position information is useful in this particular case only. It seems the whole parameter is designed around this one case. And also, in some tests the previous position is not correctly set (it is empty)

  • Custom User Avatar

    En passant is a case when previous position of the pawns matters. If a pawn just moved you can apply the en passant rule. If you did not use the rule right away you lose the opportunity to capture the en passant pawn.

  • Custom User Avatar

    The definition of "first domino" should be clarified. The instructions say to find the state if the first domino is pushed over. Therefore in a case such as " |" the result should be " /", since that is the result of pushing the first domino. The space is not a domino.

  • Custom User Avatar

    Wow this is fun, once I understood what I was meant to do. Not being able to compile outside the site is a pain though.

    I'm glad you like it. You should be able to run it outside of the site. I myself used just javac and java to write it.

    Anyway, I'm almost done only missing primeS, but I've gotten a couple random failures on the filters test (filterS should preserve satisfying elements
    ).

    All what this test does is check whether the stream filters the even ones with the predicate x -> x % 2 == 0.

    It could be that your fromS or takeS is not working properly (unfortunately I have to use those for testing). Try to play arround and look at some concrete values in your own test.

  • Custom User Avatar

    (C) the second argument *p_result_count is unnecessary and confusing since it is not referred to in the description. I first thought it was loaded with just a copy of strlen(number), but no, we are supposed to fill it. What for? It is literally just assigning to it the length of the other parameter...

  • Custom User Avatar

    (Java) Wow this is fun, once I understood what I was meant to do. Not being able to compile outside the site is a pain though. Also, I would say it is more 3 kyu than 4.
    Anyway, I'm almost done only missing primeS, but I've gotten a couple random failures on the filters test (filterS should preserve satisfying elements
    ).
    I'm not sure exactly what is going on and since they have only appeared on the "production" tests it is very hard to understand what is going on. Any idea on how I can improve this report?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Following up on my previous comment, the API is weird. It passes the player for which the check must be asserted, but this would otherwise be deducible from the last move (which is not always set). There is only one situation for which the previous move is actually relevant. It feels that the API is dirty just because of this one case. Maybe adding a specific method that checks for this? It is also quite obscure to someone with no familiar knowledge of chess

  • Custom User Avatar

    The tests do not set the previous position for any piece, which is in principle no problem if it wasn't in the spec in the first place. I would rely to only look for checks on the side that did not move, but you cannot do this since the parameter is meaningless. Either set it in the tests, or remove from the spec

  • Loading more items...