-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jump to a specific node from command line? #872
Comments
As far as I know, it is a basic feature of GoTextProtocol to load a position from a sgf file by a movenumber: 6.3.5 Regression Commands
So, you can wrap it to implement the custom: def loadsgf(file,node):
...
loadsgf(file,movenumber) |
This is great! I think I can write a wrapper in python, but how do I send the signal to Sabaki? |
You will need to embed the custom loadsgf() into a tiny gtp wrap, e.g. instead I find a relevant method in sente.py here. Or, if you know JavaScript, you can modify the source code of Sabaki and then request a pull. |
It is very easy to implement a GTP Wrap. Here is an example written in Julia, a new language similar to Python: katagoCommand=`./katago gtp -config gtp_custom.cfg -model b6/model.txt.gz`
katagoProcess=open(katagoCommand,"r+")
function query()
sentence=""
while true
sentence=readline()
if sentence=="" || "" in split(sentence," ")
continue
else
println(katagoProcess,sentence)
break
end
end
return sentence::String
end
function reply()
paragraph=""
while true
sentence=readline(katagoProcess)
if sentence==""
break
else
paragraph="$paragraph$sentence\n"
end
end
println(paragraph)
return paragraph::String
end
function play()
while true
sentence=query()
paragraph=reply()
if sentence=="quit"
break
else
continue
end
end
end
function main()
play()
end
main() |
@HackYardo Thank you so much for your help!! I read through each part of the wonderful doc of My goal is simpler: to send an external signal to Sabaki for |
loadSGF is an instruction that Sabaki is giving to the engine. GTP does not provide any method for an engine to tell Sabaki to change moves. Sabaki has no way for a program to tell it what move to advance to as fare as I can tell. |
@atw1020 @jcguu95 Well, in my view, you complicate this issue. Yeah, GTP is only a standard, it is not GTP but GTP engines/controllers do the implementing. So that either controllers or engines can implement their GTP extensions. So does a script which wraps gtp engines. That's the point. See the diagram:
There is a gtp controler in Sabaki, so one can modify Sabaki to implement some gtp extensions. |
In details:
Just fill some codes in loadsgf(). |
I'm still not sure what you are trying to describe. If you run `loadsgf in the sabaki console window, an engine using GTP will load the game, but the SGF will not show up in sabaki. As you can see in the screenshot below, the engine is successfully able to load the SGF file, however the sabaki go board does not populate with the game loaded by the command. On the other hand, you can also try to have the engine send the loadsgf command to sabaki directly. If you try to send such a command to sabaki, sabaki will ignore it because sabaki is a controller and ignores commands if an engine tries to send them. You can verify this by adding a print statement into the sente GTP engine example (see below for code modification) and then running the engine in sabaki. The command will not show up in the console. while session.active():
# respond to a command from the controller
response = session.interpret(input(""))
print(response)
# try to send
print("loadsgf ORissei-YamashiroHiroshi38563.sgf") Is there something I'm missing here? please let me know |
Question
Is it possible to jump to a specific node of an sgf file from
command line. Of course, a domain specific language for
specifying a node is required, or we may use regex matching to
find the nodes with comments. For example,
Usage
This will be useful because people can then take notes
for GO easily. For example, in org-mode (a la emacs) one can
custimize link protocols as follows.
The
[[..]]
would be turned into a link, which is then bound tothe command (non-existent?) above.
Related
The text was updated successfully, but these errors were encountered: