Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
damn you all are smart. I completed this in 6 lines of code.
I used this method :)
clarified
(C) may I suggest precluding the use of strchr, strspn, strtok_r and so on?
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.
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)
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.
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.
I'm glad you like it. You should be able to run it outside of the site. I myself used just
javac
andjava
to write it.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
ortakeS
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.(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...
(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?
This comment is hidden because it contains spoiler information about the solution
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
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
That test [[True]] is still there. It should be removed, or accepted as valid. In the end it is still [[1]]
Loading more items...