Sign in to follow this  
soggie

Go / Baduk / Weiqi game

Recommended Posts

Hi, I'm programming this: A go/baduk/weiqi game with these requirements: 1) Allows 2 players to play over the internet using sockets 2) No AI required. Only need to determine when a player liberates another player's rocks I have been figuring part 2 for a few days now - and the deadline is creeping closer. I'd like to ask whether if anybody has done this game before in C++ and MFC.. If you do, could you please email the source to me as a reference? Otherwise, if you know of any resources on the net, could you please redirect me to it? Thank you... email: soggie_tlz@yahoo.com

Share this post


Link to post
Share on other sites
This isn't hard to work out in pseudocode... and if you know what you're doing well enough to set up sockets, you should be able to take it from here. :)


Procedure remove_all_dead_stones:
for each intersection on the board:
if the intersection is empty:
mark all stones adjacent to the current intersection.
repeat until there is no change:
for each intersection on the board:
if there is a stone on the intersection:
if any adjacent intersection has a marked stone of the same colour:
mark the stone on the current intersection.
for each intersection on the board:
if there is an unmarked stone on the intersection:
remove it.



Actually, to handle the rules properly you would need to do two passes after a move; one to remove enemy stones and then one to see if any friendly stones are removed (in which case you undo everything and report that the move is illegal (suicide)).

Oh, and don't forget about ko :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this