It is a monitoring query for GO seize coding. I’ve it working efficiently. I’m fairly positive that I’m not publishing once more, it is a fully totally different query that I’ve, it’s merely the identical undertaking. The sport is full, besides to depend the territory on the finish. At present, my code counts a part of the territory, however not all the pieces, for the sake of simplicity, I encode it to detect if a set of linked empty areas is totally surrounded by stones of a colour and, in that case, it marks it as a territory. Here’s a ending recreation for reference.
My query is: How do I enable the participant to click on or proper click on on the board with out being contained in the replace loop? It isn’t inside the replace loop as a result of the replace calls a perform known as Checkvictory that calls a perform known as fakeme.
What I’m making an attempt to implement is to let the gamers mark the territories the place the stones are useless, by clicking left so as to add a spotlight. Setacive (true) and a degree, or by clicking proper to cover a spotlight. Setacive (false) and subtract a degree. The objective is that Black can mark its territory after which click on passes to permit White to mark its territory. There are at present no highlighted for a few of the Black territory within the higher proper and decrease to the best of the board.
Right here is my present code.
personal bool?(,) countExtraTerritory(bool?(,) currentTerritory)
{
Debug.Log("It's black's flip to assert territory not counted by the code. Click on Move Flip if you end up finished. Click on to make territory, proper click on to undo clicking territory.");
bool?(,) newTerritory = new bool?(19, 19);
//Counts the territory that black claims by clicking.
whereas (passCounter
Some notes: the place of Mouseover.x suits the dimensions of the traces on the board after which turns into once more an INT, which ought to give a worth of 0 to 18 anyplace on the board. I don’t need assistance to resolve this, additionally the Highlights class is distributed a matrix of Bool (19,19), if the worth is void, it’s not highlighted, if the worth is true, there’s a black spotlight, and if there’s a false worth, there’s a white spotlight.
The passcounter will increase each time the button is click on. The issue is that my loops are infinite loops as a result of whereas they run neither the Passturn button works, nor the power to click on on a sure level and generate a distinguished object. I’ve tried to examine the issue and it appears that evidently I have to name the replace once more, use a efficiency assertion or an invoked assertion, however they don’t appear to be what I’m on the lookout for.
A efficiency assertion delays the code for a specified time restrict, however what I need to do is preserve the mouse click on verification on the board till you click on the move button.
Often, within the flip of a participant, the replace perform permits you to click on in your colour stone on the best facet of the board and drag it to the place, however now I don’t need you to do it and solely able to clicking on an area on the board and add a highlighted object or click on on the move button.
I additionally tried to exchange Whereas statements with the IF statements, however the recreation merely runs the complete code and ends the sport with out clicking. I at present finish the sport by printing who received, or if the gamers tied, after which utilizing this.
Any assist can be very appreciated.