GoGrinder accidentally passes
Brought to you by:
timkington
It appears that Go Grinder occasionally passes on some SGF files, for an unknown reason; this causes the solution to become spoiled, For example in a black to move program, one will hear a "click" and then be unable to move to complete the solution. When you click "restart", the entire problem disappears. You can fix this by selecting previous (or next problem) and then moving back to the current problem. But this is a terrible bug in Go Grinder. I think I can fix it if I had access to the source. But I am not even sure anyone is maintaining this project, it hasn't been updated in years. This is the best tsumego program! We need to fix this bug!
example of a problem which occasionally chokes go grinder
GoGrinder is still alive - there just haven't been any problems worth fixing for a long time.
I'm using the problem you attached, but I haven't been able to reproduce the issue. Can you give me an exact sequence of steps that breaks GG? Are you sure the attached problem is one of the ones with the issue?
Hello. Okay I downloaded the source and started running some tests. I was very surprised. The problem is coming from the problem *before* the one which shows the error. Imagine a solution path where the third move is marked "White is dead.\nRIGHT" but there is a fourth and fifth move after the RIGHT, with another RIGHT at the end. (there are many like this on goproblems.com). This problem will trigger an error on the next problem. I think it's best to just include the file I am talking about. I have uploaded a new sgf file. place this problem in a directory with, say, 10 other problems on random mode and start solving problems. After you solve this jinxed problem, GoGrinder will not load the next problem correctly. I'm sorry for this long winded explanation. I'm looking at the source right now and if I find a simple fix I will post it here. Thanks for the quick response. I love this program!
solving this file causes go grinder to glitch on the next problem
Ok here's my fix. The problem is that doNode() is being called after nextProblem(), but before the mouse has been clicked.
1. create a global kludge-variable called "pristine".
2. set pristine to true at the beginning of nextProblem().
3. set pristine to false at the beginning of mouseClicked() and after the "enabled" check in playMouseClicked().
4. add a check at the beginning of doNode(), such that if pristine is true, doNode returns immediately.
If I find a simpler solution I will post it here. please forgive me, I don't understand CVS.
There's another solution but it seems to have a strange artifact.
If you put code like the following in the responder (before doNode()), or, right at the beginning of doNode(), it solves the problem BUT occasionally you can't hear move-click sounds. Which is a little annoying. I've used the "pristine" method in my local copy and it seems to work best. The problem seems to be that the responder thread is sleeping through the nextProblem() function and messing things up that way. Not quite sure. Here's the alternate solution, place the following code in the responder before doNode() or at the beginning of doNode():
if (n.getParent() != null)
{
SGFNode tmp = (SGFNode)n.getParent();
if (tmp.isRight())
{
return;
}
(although, of course, if you place this code in the responder you can omit the check for parent node).
Thanks again for a great program.
Here's the right way to fix it:
In SGFController.playMouseClicked(), add the if around these lines:
if(!next.isRight())
{
SGFNode resp = next.getResponse();
if(resp != null) {
enabled = false;
SwingUtilities.invokeLater(new Responder(resp));
}
}
In SGFNode add the lines marked below:
public boolean markPathsRIGHT() {
boolean ret = false;
if(right) {
SGFNode n = this;
while(n != null) {
n.rightPath = true;
>> n.right = false;
n = (SGFNode)n.parent;
}
right = true;
>> ret = true;
}
for(int i = 0; i < ch.size(); i++) {
SGFNode n = (SGFNode)ch.get(i);
ret |= n.markPathsRIGHT();
}
return ret;
}
Try making those changes, and let me know if you see any more problems.
Tim
I've merged this to MyGoGrinder: a new version with more bug fixes and new features will be available here at sf.net ( sourceforge.net/projects/mygogrinder/ ) the next days.
Greatings from Luebeck, Germany! Ruediger, ruedirf@KGS
Good news: MyGoGrinder 2 is ready and online. sf.net/p/mygogrinder
MyGoGrinder is work based on GoGrinder 1.14
Ruediger, aug.2014
In the message above Tim wrote
but that line was already present, instead the line
right = true;
was to be added.
Ruediger