Search

Thursday, August 23, 2012

Day 15: Killing groups, part II



Something was missing in the last post. I should add the dead stones to a "dead stones counter", so I created 2 new private variables in board.




Everytime a group is killed, I have to add all those stones to one of the counters. Now the killing method of the board will be something like this:



I just have to create a method to return how many dead stones have a player, that's easy, something like "getDeadStones(int color)" and show it on the screen using the console class.

Next: 2 rules to add: ko and suicide.

No comments:

Post a Comment