Ad
  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Whose turn is it first and does placing handicap stones whose turn it is?

  • Custom User Avatar
    game = Go(9)
    moves = ["4D","3D","4H","5D","3H","4C","5B","4E"]
    game.move(*moves)
    game.get_position('4D')
    

    This produces the following board:

    .........
    .........
    .........
    .........
    .x.o.....
    ..oxo..x.
    ...o...x.
    .........
    .........
    

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

  • Custom User Avatar

    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

    Go g = new Go(5, 7);
    String[] moves = new String[] { "4B", "3E", "3C", "1E", "4F", "2G", "3D", "2E", "4A", "3B", "4G", "1A", "3E",
    			"2A", "2B", "3B", "3B", "1F", "1E", "2A", "3D", "3E", "4D", "1A", "4A", "3A", "1A", "1C", "3F", "4F",
    			"1A", "3D", "3F", "3B", "4A", "1C", "2C", "1B", "3F", "2B", "2C", "1A", "1D", "2A", "1B", "4E", "1A",
    			"2G", "3A", "2A", "4D", "2A", "1B", "1E", "3B", "1D", "1E", "1E" };
    for (String s : moves) {
    	try {
    		g.move(s);
    	} catch (IllegalArgumentException e) {
    	}
    }
    

    What I end up with is

      A B C D E F G 
    5 . . . . . . . 
    4 x x . o o x x 
    3 x o x x o x . 
    2 x o . . o . o 
    1 x x o o o x . 
    

    and while I can't see what it should be, I'm getting the error

    arrays first differed at element [1][4]; expected:<x> but was:<o>
    

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    test_HandicapStones_FailPlacingTwiceInRow in Java demands an IllegalArgumentException 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 like IllegalStateException.

    The same is true for the test_HandicapStones_FailIfNotAtTheBeginning test.

    Regarding test_HandicapStones_FailBoardSize, it would be better to throw an UnsupportedOperationException.

    The only case when handicapStones should throw an IllegalArgumentException would be the case when the number of stones passed is indeed invalid (e.g. zero, negative or too large).

  • Custom User Avatar

    Shouldn't the last move of "Multiple Captures" return an error due to self-capturing? img

  • Custom User Avatar

    When move takes multiple arguments and one of them is invalid, do we rollback all the moves or just the one invalid one?