kifuwarabe-go-toramedal

command module
v0.0.0-...-292cba7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 14 Imported by: 0

README

きふわらべ 碁 虎メダル

第14回UEC杯コンピュータ囲碁大会向けきふわらべ

GoGo をベースとしています
📖 GoGo

Set up

Set up - 1 - Get a GUI

きふわらべは 思考エンジンだけですので、GUI が別途必要です。
ここでは CgfGoBan で動かす例を示します。

20221009_1601_cgfgoban110_o1.png

📖 CgfGoBan

👆 cgfgoban110.zip をクリックして cgfgoban110.zip ファイルをダウンロードしてきてください

20221009_1615_unzip.png

👆 がんばって 好きなところに解凍してください

20221009_1619_files.png

👆 最初の中身はこんな感じです

Set up - 2 - Make directories

20221009_2238_make_directories.png

👆 CgfGoBan の cgfgoban.exe ファイルと同じディレクトリーに、
以下の図を参考に 📄 input/game_conf.toml と 📂 output(空ディレクトリー) を置いてください
game_conf.toml は、このリポジトリの 📂 input の中に置いてあります

📂 cgfgoban108
|
+----📂 input
|    |
|    +----📄 game_conf.toml (設定ファイル)
|
+----📂 output (空っぽ)
|
+----📄 cgfgoban.exe

game_conf.toml テキストファイルの内容は以下の通りです

[Game]
# デフォルト値です。 CgfGoBan などの GUI はこのファイルを見ません

# Komi - コミ☆(^~^)
Komi = 6.5

# BoardSize - 何路盤。
BoardSize = 19

# MaxMoves - 最大手数。
MaxMoves = 1000

BoardData = '''
	3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
	3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
	3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
	3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
	3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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3, 3, 3, 3, 3, 3, 3,
'''

Set up - 3 - Download exe

次に、以下から きふわらべの kifuwarabe-go-toramedal.exe ファイルを入手してください。

20220130go71a2.png

📖 kifuwarabe-go-toramedal Release 0.0.1

👆 .zip に圧縮されているので、解凍してください。
もし ウィルス扱いされてダウンロードできないなら、 以下の方法で、ソースをビルドして kifuwarabe-go-toramedal.exe を作ってください。

Set up - 4 - Download source

きふわらべの .exe をソースからビルドして作る方法です。

20220130thr-go9a2.png

👆 がんばって ソースをどこかに置いてください。 わたしは
C:\Users\むずでょ\Documents\GitHub\kifuwarabe-collection\go\kifuwarabe-go-toramedal
に置いています

きふわらべのソースコードは、2つの方法で入手できます

20220130go71a3.png

📖 kifuwarabe-go-toramedal Release 0.0.1

👆 1つ目は、 リリースページの src をクリックする方法です。

20220130go73a2.png

👆 2つ目は、 GitHub Desktop を使ってダウンロードする方法です。 がんばって GitHub Desktop をインストールしておいてください。

GitHub Desktop

👆 そのあと がんばって ローカルPCに kifuwarabe-go-toramedal のリポジトリ― を作ってください

Set up - 5 - Editor

20220130go72.png

📖 Visual Studio Code

👆 わたしは プログラムを編集するツールとして Visual Studio Code を使います。 がんばって インストールしてください
がんばって kifuwarabe-go-toramedal のリポジトリ― の📂フォルダーを開いてください。
上図画面下のコマンドを打つところは ターミナル という名前です。 がんばって ターミナルを表示してください。

Set up - 6 - Install Go Programming Language

20220130thr-go1a2.png

📖 きふわらべのGo言語インストール解説

👆 Go言語のインストール方法を解説しました。読んでください

Set up - 7 - Build

Visual Studio Code に戻りまして。

20220130go75a2.png

# debug build
go build

# release build
go build -ldflags "-s -w"

👆 ターミナルに上記のコマンドを打鍵してください。 kifuwarabe-go-toramedal.exe 実行ファイルが作成されます。
お疲れさまでした。

Run

ターミナルで以下のコマンドを打鍵すると、ターミナルで実行することもできます。
(Power shell ではなく、 Command Prompt です)

# GTP形式の思考エンジンとして対局するなら
kifuwarabe-go-toramedal

# 動作テストするなら
kifuwarabe-go-toramedal SelfPlay

👆 拡張子を省いた実行ファイル名を打鍵してください

Set up - 8 - CgfGoBan

20221009_2255_launch_cgfgoban.png

👆 CgfGoBan を起動してください

20221009_2256_configure_gtp.png

👆 CgfGoBan を開いて、 [設定] - [GTPの設定] と進んでください

20221009_2302_gtp_setting.png

👆 (さきほどビルドした) きふわらべの .exe ファイルへのフルパスを入れてください

Tips
.exe ファイルの名前は kifuwarabe-go-toramedal-copy.exe のように名前を変えておくと、
CgfGoBanでテスト対局させているとき、Visual Studio Code で開発中に go build できない、といった衝突がなくなります

20221009_2305_game_start.png

👆 [対局] - [対局開始] と進んでください

20221009_2307_play_setting.png

👆 Black と White のどちらか片方を Human 、反対側を Computer(GTP) にしてください

20221009_2311_play.png

👆 これで きふわらべと対局できました。
お疲れさまでした。

参考にした記事

Go言語

📖 Go言語でハマったことメモ(値渡し・ポインター渡し)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
engine
coding_obj
標準出力とロガーを一緒にしただけのもの
標準出力とロガーを一緒にしただけのもの

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL