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.
This kata's description is ridiculously badly written. It is so frustrating to write the whole solution just to find out at the end that there is supposed to be a rollback functionality. The self capture move is not explained, some edge cases are not explained, important information does not get highlighted enough (letter I does not count etc.). This kata would be pretty fun to complete if not for this terrible explanation...
Whose turn is it first and does placing handicap stones whose turn it is?
This produces the following board:
There is a single black piece surrounded by four white pieces, but the tests claim that
"Black captures single white stone"
. This should read"White captures single black stone"
.Language is Java BTW. I'm having some trouble with the random tests and I can't see what I'm doing wrong. The smallest test I've seen that I fail has no rollbacks and is just simple moves. It can be recreated with
What I end up with is
and while I can't see what it should be, I'm getting the error
element[1][4] is "4E" which is only set once and, according to my program, it is set by white. Can anyone that has completed this tell me what this move set should result in? I can complete every other test and most of the time I can complete 30+ random tests, but no matter how many times I try I can't complete this thing.
My solution counts placing handicap stones as a move, although it is not stated anywhere that this is legal. Whatever's the expected behavior, it should be tested explicitly.
It is not stated what to do when the amount of moves to roll back is higher than the amount of moves made during the game.
test_HandicapStones_FailPlacingTwiceInRow
in Java demands anIllegalArgumentException
be thrown. I think that this kind of exception is inappropriate for this case because value of the argument is irrelevant here. It would be better to throw something likeIllegalStateException
.The same is true for the
test_HandicapStones_FailIfNotAtTheBeginning
test.Regarding
test_HandicapStones_FailBoardSize
, it would be better to throw anUnsupportedOperationException
.The only case when
handicapStones
should throw anIllegalArgumentException
would be the case when the number of stones passed is indeed invalid (e.g. zero, negative or too large).Shouldn't the last move of "Multiple Captures" return an error due to self-capturing? img
When move takes multiple arguments and one of them is invalid, do we rollback all the moves or just the one invalid one?