Skip to content
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

SGF文字列の読込 #97

Open
kaorahi opened this issue Jan 10, 2024 · 1 comment
Open

SGF文字列の読込 #97

kaorahi opened this issue Jan 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@kaorahi
Copy link
Contributor

kaorahi commented Jan 10, 2024

経緯は #91 を参照.

GTP の load_sgf <SGFファイル名> の変種で tamago-read_sgf <SGF文字列> がほしい.

デバッグなどで適当な局面を解析したいときに, GUI で棋譜を編集 → クリップボードに SGF をコピー → term に貼りつけて次のように実行, ができると手軽.

SGF='(;SZ[9]KM[7];B[fe];W[de];B[ec])'
echo "tamago-read_sgf $SGF\n..." | python3 main.py ...

現状では, いちいち SGF ファイルを作るか, 「play b ...」のような GTP コマンド列を用意するかが必要でおっくう.

実装例は kaorahi/TamaGo@841fadd. README を書き足して PR を送る予定です.

ところで, よく見たら SGF の標準コマンドは load_sgf ではなく loadsgf ですね. 互換性を考えたら, loadsgfload_sgf を別名として両方サポートした上で, 新コマンドは tamago-readsgf にしておくほうがすっきりかもしれません.

http://www.lysator.liu.se/~gunnar/gtp/gtp2-spec-draft2/gtp2-spec.html#SECTION00073500000000000000

@kobanium
Copy link
Owner

load_sgfコマンドについてはリグレッションテスト用コマンドなので、おそらくGUIから参照されることはなく、特段互換性を保つ必要はなさそうです。
GTPコマンドの実装ミスになりますので、別のissueを立てて作成します。
本issueで作成するコマンドは'''tamago-readsgf'で良いと思います。

kaorahi added a commit to kaorahi/TamaGo that referenced this issue Jan 10, 2024
kobanium added a commit that referenced this issue Jan 10, 2024
Implement #97 (tamago-readsgf)
@kobanium kobanium added the enhancement New feature or request label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants