LoginSignup
1
1

More than 5 years have passed since last update.

コンピュータ囲碁プログラム CgfGoBan を多プログラム言語対応に改造しよう

Last updated at Posted at 2017-03-17

前回の記事 : http://qiita.com/muzudho1/items/a803ad17b6fae77f153d

(CgfGoBan)
http://www.yss-aya.com/cgfgoban_j.html

CGF碁盤は英語版のページからダウンロードできる。

Gazo

解凍しよう。

Gazo

内容物は、

-cgfgoban.exe のソース
-cgfthink.dll のソース
-実行ファイル
-説明書
-石を置く音

になっている。ここでやりたいことは、cgfthink.dll を自作に改造することだろう。

cgfthink.dll のソース

Gazo

ソースが Visual C++ 6.0 のようなんだが、自分の環境の Visual Studio 2015 C++ に合わせたい。とりあえず cgfthink.dsw をダブルクリックする。

アップグレードしてくれるので 進めていく。

Gazo

古いファイルを消してくれないので、消すことにする。

Gazo

こうなる。

これからは、cgfthink.sln をダブルクリックして Visual Studio 2015 を立ち上げることにする。

このファイルは .dll なので、実行はできない。
コンパイルだけしてみる。

これを そのままコンパイルしても、

output

1>------ Build started: Project: cgfthink, Configuration: Debug Win32 ------
1>cl : Command line error D8016: '/ZI' and '/Gy-' command-line options are incompatible
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

コンパイル・エラーになる。

初期画面では

Gazo

Debugモードで、CPUは x86 になっているかと思う。

[Build] - [Configuration Manager...] と進み、
とりあえず Debugモードの新しい構成を作ろう。

Gazo

CPU を [] を選んで、x86 をコピーして x64 の設定を作る、というように進める。

名前を x64 にしただけで設定は変えていないので、これをコンパイルすると

output

1>------ Build started: Project: cgfthink, Configuration: Debug x64 ------
1>  cgfthink.c
1>cgfthink.c(85): warning C4996: '_vsnprintf': This function or variable may be unsafe. Consider using _vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1396): note: see declaration of '_vsnprintf'
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1189,5): warning MSB8012: TargetPath(C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfthink\x64\Debug\cgfthink.dll) does not match the Linker's OutputFile property value (C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfthink\Debug\cgfthink.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>     Creating library .\Debug\cgfthink.lib and object .\Debug\cgfthink.exp
1>  cgfthink.vcxproj -> C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfthink\x64\Debug\cgfthink.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

コンパイルは通るが CPUの設定が x86 のままだ。

Gazo

プロジェクトのプロパティーを開こう。

ところで 書き残しておくと これから囲碁プログラムをやり始める人に便利だろう、と思って わざわざ画像を貼り付けて 記事を書いてるんだが、
今どきの日本の10代、20代は パソコン 持ってないんだな。スマホでWebサイト見てるんだろ。

こんな記事 書いても無駄だな、と思いつつ だったら英語で書いて グーグル検索に拾ってもらった方が マシだよな。そして ゲームを作る人は Unity から入っていくだろう。Visual Studio 2015 C++ の基本操作とか 需要が細い気がするんだが まあ いいだろう。不特定多数の人に広く読んでほしい記事を書きたかったら Qiita なんかに書いていてはいけないんだぜ。

「方法 : Visual C++ プロジェクトを 64 ビット プラットフォーム用に設定する」(MSDN)
https://msdn.microsoft.com/ja-jp/library/9yb4317s.aspx

というか Visual Studio 2017 にしては

ダウンロードするか~。

(Visual Studio 2017)
https://www.visualstudio.com/ja/vs/whatsnew/

なんだか Visual Studio 2017 のインストーラーに従っているのが親切そうだ。

インストール時間が長い。開始時刻をメモっとけばよかった。
何時間かかるのか メーターからは判断できない。旧バージョンの Visual Studio は起動していてはいけないみたいだし、やることは無くなった。

教訓:インストールは夜中にやろう。

Visual Studio 2017 にすれば、64ビットCPUに対応させるのも初期設定で選べる

Gazo

これで解決! Visual Studio 2015 は介さずに Visual Studio 2017 にアップグレードしてもらおう。

Gazo

64bit 版にしたからか、CGF碁盤 が読み取ってくれなくなった。
CGF碁盤 も64bit 版にしたらどうか?

1>------ ビルドのスキップ: プロジェクト:cgfgoban, 構成:Debug Win32 ------
1>プロジェクトはこのソリューション構成に対してビルドするように選択されていません。 
========== ビルド: 正常終了または最新の状態 0、失敗 0、スキップ 1 ==========

なぜ こっちはアップグレードをしてくれないのか?
.zip ファイルの解凍からやり直してみよう。

cgfgoban.dsp の方を開くと アップデートしてくれるんだろうか?

1>------ ビルド開始: プロジェクト:cgfgoban, 構成:Debug x64 ------
1>cgfgoban.cpp
1>cgfgoban.cpp(107): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(114): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(115): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(117): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(120): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(123): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(126): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(130): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(151): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(152): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(154): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(155): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(167): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(172): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgfgoban.cpp(197): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgfgoban.cpp(249): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_main.cpp
1>cgf_pipe.cpp
1>cgf_pipe.cpp(29): warning C4244: '初期化中': 'intptr_t' から 'long' への変換です。データが失われる可能性があります。
1>cgf_pipe.cpp(24): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_pipe.cpp(155): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_pipe.cpp(174): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(2254): note: 'sscanf' の宣言を確認してください
1>cgf_pipe.cpp(176): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: 'stricmp' の宣言を確認してください
1>cgf_pipe.cpp(177): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: 'stricmp' の宣言を確認してください
1>cgf_pipe.cpp(195): warning C4267: '引数': 'size_t' から 'DWORD' に変換しました。データが失われているかもしれません。
1>cgf_pipe.cpp(285): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(286): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(293): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(319): warning C4267: '初期化中': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_pipe.cpp(327): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_pipe.cpp(303): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(308): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(318): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_pipe.cpp(325): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(90): note: 'strcat' の宣言を確認してください
1>cgf_pipe.cpp(326): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(90): note: 'strcat' の宣言を確認してください
1>cgf_pipe.cpp(355): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(356): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_pipe.cpp(394): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_term.cpp
1>cgf_term.cpp(101): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_term.cpp(387): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp
1>cgf_win.cpp(370): warning C4244: 'return': 'WPARAM' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(341): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(420): warning C4244: '=': 'SIZE_T' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(768): warning C4244: '初期化中': 'WPARAM' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(432): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(433): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(449): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(450): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(769): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(1118): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(1218): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1400): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1401): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1429): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1437): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1446): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1463): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1511): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1512): warning C4244: '=': 'LRESULT' から 'int' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1337): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1360): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1373): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1484): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(1585): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1625): warning C4244: '引数': 'LPARAM' から 'LONG' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1816): warning C4267: '引数': 'size_t' から 'DWORD' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(1757): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(505): note: 'localtime' の宣言を確認してください
1>cgf_win.cpp(1770): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1771): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1804): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1811): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: 'stricmp' の宣言を確認してください
1>cgf_win.cpp(1871): warning C4244: '=': '__int64' から 'WORD' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(1862): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(1863): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(1867): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(1873): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(1889): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(1905): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: 'stricmp' の宣言を確認してください
1>cgf_win.cpp(1907): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: 'stricmp' の宣言を確認してください
1>cgf_win.cpp(2085): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2089): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2108): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2112): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2116): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2120): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2124): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2217): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2214): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1465): note: 'vsprintf' の宣言を確認してください
1>cgf_win.cpp(2220): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: 'strncpy' の宣言を確認してください
1>cgf_win.cpp(2238): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(505): note: 'localtime' の宣言を確認してください
1>cgf_win.cpp(2347): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: 'strncpy' の宣言を確認してください
1>cgf_win.cpp(2348): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: 'strncpy' の宣言を確認してください
1>cgf_win.cpp(2349): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: 'strncpy' の宣言を確認してください
1>cgf_win.cpp(2350): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: 'strncpy' の宣言を確認してください
1>cgf_win.cpp(2398): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(505): note: 'localtime' の宣言を確認してください
1>cgf_win.cpp(2520): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2489): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1465): note: 'vsprintf' の宣言を確認してください
1>cgf_win.cpp(2493): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(2494): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(90): note: 'strcat' の宣言を確認してください
1>cgf_win.cpp(2495): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(205): note: 'fopen' の宣言を確認してください
1>cgf_win.cpp(2561): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2642): warning C4267: '初期化中': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2769): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2817): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2819): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2828): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2830): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2853): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2906): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3026): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3028): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3032): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3035): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3038): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3040): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3043): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3054): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3058): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3062): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3065): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3070): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3090): warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(2816): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2818): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2827): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2829): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2852): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2905): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(2960): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3025): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3027): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3031): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3034): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3037): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3039): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3042): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3046): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3049): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3051): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3056): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3057): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3064): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3087): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3159): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3163): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3165): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3168): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3169): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(90): note: 'strcat' の宣言を確認してください
1>cgf_win.cpp(3465): warning C4244: '引数': 'UINT_PTR' から 'UINT' への変換です。データが失われる可能性があります。
1>cgf_win.cpp(3544): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(2254): note: 'sscanf' の宣言を確認してください
1>cgf_win.cpp(3583): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3632): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3683): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3685): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3687): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3689): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3712): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(3724): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3744): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3746): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3748): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3750): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3785): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3804): warning C4267: '=': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_win.cpp(3810): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(3811): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(3814): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(3815): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(3816): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_win.cpp(3841): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3842): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_win.cpp(3843): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(90): note: 'strcat' の宣言を確認してください
1>cgf_win.cpp(3855): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: 'strcpy' の宣言を確認してください
1>cgf_wsk.cpp
1>cgf_wsk.cpp(55): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(61): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(63): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(74): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(94): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(102): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(106): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>cgf_wsk.cpp(120): warning C4267: '初期化中': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
1>cgf_wsk.cpp(133): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): note: 'sprintf' の宣言を確認してください
1>コードを生成中...
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(1198,5): warning MSB8012: TargetPath(C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfgoban\x64\Debug\cgfgoban.exe) が Linker の OutputFile プロパティ値 (C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfgoban\Debug\cgfgoban.exe) と一致しません。このため、プロジェクトが正常にビルドされない可能性があります。この問題を解決するには、$(OutDir)、$(TargetName)、および $(TargetExt) の各プロパティ値が、%(Link.OutputFile) で指定されている値と一致することを確認してください。
1>cgfgoban.vcxproj -> C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfgoban\x64\Debug\cgfgoban.exe
1>cgfgoban.vcxproj -> C:\Users\Takahashi\Documents\muzudho\Igo\Kifuwarabe_IP\cgfgoban108\cgfgoban\x64\Debug\cgfgoban.pdb (Full PDB)
1>プロジェクト "cgfgoban.vcxproj" のビルドが終了しました。
========== ビルド: 1 正常終了、0 失敗、0 更新不要、0 スキップ ==========

よし、いけた。

Gazo

64bit 版同士なら起動もしてくれるようだ。

思考部分

Gazo

この cgfgui_thinking が 着手(指し手)を返す関数だ。

どういう仕組みかというと、CGF碁盤が 単にこの関数を呼び出してくれる。
そこで 石を置く場所(着手)を 返り値として返せばいいわけだ。

そのあたりについては

「コンピュータ囲碁プログラム CGF碁盤プロトコル」(Qiita)
http://qiita.com/muzudho1/items/ddf9eb068ecfce8c5ec2

に詳しく書いた。今回は C++言語以外のあらゆる言語に対応させる サンプル・プログラムを考えたい。

つまり この関数の部分を、

  • 状況を書いたテキストファイルの書き出し
  • 着手(指し手)を書いた テキスト・ファイルの読込み

にしてしまえば どんな言語にも対応できるんじゃないか。

状況を書き出すテキストファイルの形式を考えよう

board begin
3,3,3,3
3,0,0,0
3,0,0,0
...
3,0,0,0
3,3,3,3
board end

めんどくさいので全部は書かないが、碁盤は 21行256列 のデータになるだろう。
カンマ区切りにするとしよう。

  • 0: 空き
  • 1: 黒石
  • 2: 白石
  • 3: 枠

だ。

とりあえず盤のサイズは 19路盤 固定として 省くとする。
コミも 6.5 固定として 省くとする。

じゃあ、碁盤だけ書き出せばいいのか。

「C++でテキストに書き出す方法」(Qiita)
http://qiita.com/fantm21/items/8489b944698f9d3818ea

ファイル名は雑に out.txt とかにするか。

// (2017-03-17 Add begin)
#include <iostream>
#include <fstream>
// (2017-03-17 Add end)
// ↑ファイルの上の方に書く
std::ofstream os("out.txt");
os << "test";
os.close();

コンパイルが通らない。あれ、なんだか おかしいな。 よく見るとこれ、C++ じゃなくて C じゃないか。

cgfthink.c を cgfthink.cpp に変えてコンパイルすると コンパイルは通るんだが、CGF碁盤が cgfthink.dll を認識してくれなくなる。

じゃあ C で書くか。

「C言語 テキストファイルの書き込み - stdio.h - [ fputc, putc, fputs ]」(勇躍のゴミ箱)
http://simd.jugem.jp/?eid=51

そしてこのソースコード、シフトJIS だ。Unicode に変換すると問題があるだろうか?

無難に Shift-JIS で保存。

「ファイルへの出力」(プログラミング C (2006年度 秋学期実施))
http://ylb.jp/2006b/proc/fileio/fileoutput.html

    // (2017-03-17 Add begin)
    // ファイル書き出し
    {
        FILE* fp;
        char* fname = "out.txt";
        char* str = "Hello World\nThe C Programming Language\nTest Test";

        fp = fopen(fname, "w");
        if (fp == NULL) {
            printf("%s file can not open.\n", fname);
            return -1;
        }

        // 現局面を出力
        for (int y = 0; y<21; y++)
        {
            for (int x = 0; x<21; x++)
            {
                int i = y * 256 + x;
                char buffer[20];
                itoa(board[i], buffer, 10);
                fprintf(fp, buffer);
                fprintf(fp, ",");
            }
            fprintf(fp, "\n");
        }
        {
            char buffer[20];

            // アゲハマを出力
            itoa(hama[0], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            itoa(hama[1], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            // 累計思考時間を出力
            itoa(sg_time[0], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            itoa(sg_time[1], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            // コウを出力
            itoa(kou_z, buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            fprintf(fp, "\n");
        }

        fclose(fp);
    }
    // (2017-03-17 Add end)

とりあえず こう書いたんだが、書き出される盤面が1手前のものだ。もう少し調べてみよう。

out.txt

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,2,0,0,0,0,0,0,2,0,0,2,3,
3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,3,
3,0,0,0,0,1,0,2,2,0,0,0,0,0,0,0,2,0,0,0,3,
3,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,2,2,0,0,3,
3,0,1,2,0,0,0,0,2,2,2,1,0,0,0,2,1,0,0,0,3,
3,0,2,0,2,1,0,0,2,0,0,2,0,0,0,0,2,0,0,0,3,
3,0,0,0,0,0,0,2,0,0,0,2,0,0,1,2,0,0,0,0,3,
3,0,0,0,0,0,2,0,0,0,2,2,0,2,1,2,0,0,0,0,3,
3,0,0,0,0,1,1,2,0,0,2,0,2,0,2,0,2,1,0,0,3,
3,0,0,0,0,0,0,2,0,0,0,0,2,1,0,2,1,0,0,0,3,
3,0,0,0,0,0,0,0,2,0,0,0,0,2,0,1,0,0,0,0,3,
3,0,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,1,0,0,3,
3,0,0,0,1,0,0,0,0,0,2,0,0,2,1,0,1,0,0,0,3,
3,0,0,0,0,0,2,1,2,1,0,2,2,0,0,0,1,0,0,0,3,
3,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,0,0,3,
3,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,3,
3,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,3,
3,0,0,0,0,0,0,0,0,0,1,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,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
7,26,157,0,0,

気のせいだろうか?

じゃあ、次は入力ファイルを作ろう。

in.txt

4,13

というファイルがあれば、x,y で、4列目の13段に打つことにしよう。

y*256+x

の式に当てはめれば、CGF碁盤でも使えるだろう。

いーや。C言語でパーサーを書くのがめんどうだ。

3332

と計算後の数字が入っていることにする。
10進 3332 は、16進 0x0d04。 y,x の順なのでひっくりかえせば 4,13 で合ってる。

    // (2017-03-17 Add begin)
    // ファイル読込
    ret_z = -1;
    {
        FILE* fp;
        char* fname = "in.txt";
        char buffer[100];

        fp = fopen(fname, "r");
        if (fp == NULL) {
            // ファイルを読込めなかった
        }
        else
        {
            if (fgets(buffer, 100, fp) != NULL) {
                ret_z = atoi(buffer);
            }
            fclose(fp);
        }
    }
    // (2017-03-17 Add end)

    if (-1 == ret_z)
    {
        ret_z = think_sample(col);
    }

こうしてやれば、既存のランダム指しと併用できる。
in.txt は、読み取ったんなら削除して欲しいが。

「C言語 ファイルの削除 - stdio.h - [ remove ]」(勇躍のゴミ箱)
http://simd.jugem.jp/?eid=55

よし、削除もいけた。改造コードは 次のような感じだ。

cgfthink.c cgfgui_thinking 関数

// 思考ルーチン。次の1手を返す。
// 本体から初期盤面、棋譜、手数、手番、盤のサイズ、コミ、が入った状態で呼ばれる。
DLL_EXPORT int cgfgui_thinking(
    int dll_init_board[],   // 初期盤面
    int dll_kifu[][3],      // 棋譜  [][0]...座標、[][1]...石の色、[][2]...消費時間(秒)
    int dll_tesuu,          // 手数
    int dll_black_turn,     // 手番(黒番...1、白番...0)
    int dll_board_size,     // 盤面のサイズ
    double dll_komi,        // コミ
    int dll_endgame_type,   // 0...通常の思考、1...終局処理、2...図形を表示、3...数値を表示。
    int dll_endgame_board[] // 終局処理の結果を代入する。
)
{
    int z,col,t,i,ret_z;

    // 現在局面を棋譜と初期盤面から作る
    for (i=0;i<BOARD_MAX;i++) board[i] = dll_init_board[i]; // 初期盤面をコピー
    board_size = dll_board_size;
    hama[0] = hama[1] = 0;
    sg_time[0] = sg_time[1] = 0;    // 累計思考時間を初期化
    kou_z = 0;

    for (i=0;i<dll_tesuu;i++) {
        z   = dll_kifu[i][0];   // 座標、y*256 + x の形で入っている
        col = dll_kifu[i][1];   // 石の色
        t   = dll_kifu[i][2];   // 消費時間
        sg_time[i&1] += t;
        if ( move_one(z,col) != MOVE_SUCCESS ) break;
    }

#if 0   // 中断処理を入れる場合のサンプル。0を1にすればコンパイルされます。
    for (i=0;i<300;i++) {               // 300*10ms = 3000ms = 3秒待ちます。
        PassWindowsSystem();            // 一時的にWindowsに制御を渡します。
        if ( *pThinkStop != 0 ) break;  // 中断ボタンが押された場合。
        Sleep(10);                      // 10ms(0.01秒)停止。
    }
#endif

    // 終局処理、図形、数値を表示する場合
    if ( dll_endgame_type == GAME_END_STATUS  ) return endgame_status(dll_endgame_board);
    if ( dll_endgame_type == GAME_DRAW_FIGURE ) return endgame_draw_figure(dll_endgame_board);
    if ( dll_endgame_type == GAME_DRAW_NUMBER ) return endgame_draw_number(dll_endgame_board);

    // サンプルの思考ルーチンを呼ぶ
    if ( dll_black_turn ) col = BLACK;
    else                  col = WHITE;

    // (2017-03-17 Add begin)
    // ファイル書き出し
    {
        FILE* fp;
        char* fname = "out.txt";
        char* str = "Hello World\nThe C Programming Language\nTest Test";

        fp = fopen(fname, "w");
        if (fp == NULL) {
            printf("%s file can not open.\n", fname);
            return -1;
        }

        // 現局面を出力
        for (int y = 0; y<21; y++)
        {
            for (int x = 0; x<21; x++)
            {
                int i = y * 256 + x;
                char buffer[20];
                itoa(board[i], buffer, 10);
                fprintf(fp, buffer);
                fprintf(fp, ",");
            }
            fprintf(fp, "\n");
        }
        {
            char buffer[20];

            // アゲハマを出力
            itoa(hama[0], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            itoa(hama[1], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            // 累計思考時間を出力
            itoa(sg_time[0], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            itoa(sg_time[1], buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            // コウを出力
            itoa(kou_z, buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            // 手番(石の色)を出力
            itoa(col, buffer, 10);
            fprintf(fp, buffer);
            fprintf(fp, ",");

            fprintf(fp, "\n");
        }

        fclose(fp);
    }
    // (2017-03-17 Add end)

    // (2017-03-17 Add begin)
    // ファイル読込
    ret_z = -1;
    {
        FILE* fp;
        char* fname = "in.txt";
        char buffer[100];

        fp = fopen(fname, "r");
        if (fp == NULL) {
            // ファイルを読込めなかった
        }
        else
        {
            if (fgets(buffer, 100, fp) != NULL) {
                ret_z = atoi(buffer);
            }
            fclose(fp);

            if (remove(fname) == 0) {
                // ファイルの削除成功
            }
            else {
                // ファイルの削除失敗
            }
        }
    }
    // (2017-03-17 Add end)

    if (-1 == ret_z)
    {
        ret_z = think_sample(col);
    }

    PRT("思考時間:先手=%d秒、後手=%d秒\n",sg_time[0],sg_time[1]);
    PRT("着手=(%2d,%2d)(%04x), 手数=%d,手番=%d,盤size=%d,komi=%.1f\n",(ret_z&0xff),(ret_z>>8),ret_z, dll_tesuu,dll_black_turn,dll_board_size,dll_komi);
//  print_board();
    return ret_z;
}

これがあれば、どのプログラム言語を使っていようと、テキストファイルを介して コンピュータ囲碁プログラムで通信対戦できるんじゃないか?

まあ、それが GTP(Go Text Protocol)の役目だと思うんだが、あれ、仕様がでかいし。

それに比べてこの改造方法だと、

out.txt

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,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,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,1,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,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,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,0,0,0,0,0,0,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,2,

in.txt (※余計な空白や、末尾に改行は入れないこと)

3332

out.txt の読み込みと in.txt の書き出しができればいい。

本当か?

改造版 cgfthink.dll / cgfgoban.exe と、C#言語版のコンピュータ囲碁プログラムが通信できるか試したい。

自作のコンピュータ囲碁プログラムに、
テキスト・ファイルの読書きで対局、なんていうモードを付けてないので、
こっちも改造が必要だ。

-19路盤
-置き石なし
-コミ6.5
-日本ルール
-手番は out.txt ファイルを見て判定
-指し手は y*256+x にして in.txt ファイルとして出力

という形にすればいいだろうか。

Visual Studio 2017 で C# の機能が欲しいときは Visual Studio Installer というのを使えばいいのか。

// 書きかけ

「スリープ処理」(碧色工房)
http://www.mm2d.net/main/prog/c/sleep-01.html

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1