diff --git a/Random/TTTPlugin.h b/Random/TTTPlugin.h index dcdc8af..519337d 100644 --- a/Random/TTTPlugin.h +++ b/Random/TTTPlugin.h @@ -7,5 +7,5 @@ // 既定の関数 __declspec(dllexport) bool IsHuman(); __declspec(dllexport) void GetName(char* buf, size_t bufsize); - __declspec(dllexport) int MyTurn(int* board, int turn, int player); + __declspec(dllexport) int MyTurn(int* board); } diff --git a/Random/random.cpp b/Random/random.cpp index 9916f4f..57ab10c 100644 --- a/Random/random.cpp +++ b/Random/random.cpp @@ -22,11 +22,9 @@ /// /// 手を打つ /// -/// 盤の状態 -/// ターン数 -/// 1:先手, 2:後手 +/// 盤の状態(値 1~3は自分駒,-1~-3は相手駒,次置くと1が消える) /// 置く場所 -int MyTurn(int* board, int turn, int player) { +int MyTurn(int* board) { std::random_device rnd; int pos; diff --git a/TPIHuman/Human.cpp b/TPIHuman/Human.cpp index 7eaf828..ccdc2a8 100644 --- a/TPIHuman/Human.cpp +++ b/TPIHuman/Human.cpp @@ -21,11 +21,9 @@ /// /// 手を打つ /// -/// 盤の状態 -/// ターン数 -/// 1:先手, 2:後手 +/// 盤の状態(値 1~3は自分駒,-1~-3は相手駒,次置くと1が消える) /// 置く場所 -int MyTurn(int* board, int turn, int player) { +int MyTurn(int* board) { int pos = 0; do { diff --git a/TPIHuman/TTTPlugin.h b/TPIHuman/TTTPlugin.h index dcdc8af..519337d 100644 --- a/TPIHuman/TTTPlugin.h +++ b/TPIHuman/TTTPlugin.h @@ -7,5 +7,5 @@ // 既定の関数 __declspec(dllexport) bool IsHuman(); __declspec(dllexport) void GetName(char* buf, size_t bufsize); - __declspec(dllexport) int MyTurn(int* board, int turn, int player); + __declspec(dllexport) int MyTurn(int* board); } diff --git a/TTTConsole/Program.cs b/TTTConsole/Program.cs index 52ebbac..090f18d 100644 --- a/TTTConsole/Program.cs +++ b/TTTConsole/Program.cs @@ -17,7 +17,7 @@ private extern static void GetNameR(StringBuilder s, Int32 bufsize); [DllImport("TPIRandom.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "MyTurn")] - private extern static int MyTurnR(IntPtr board, int turn, int player); + private extern static int MyTurnR(IntPtr board); [DllImport("TPIRandom.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IsHuman")] private extern static bool IsHumanH(); @@ -26,7 +26,7 @@ private extern static void GetNameH(StringBuilder s, Int32 bufsize); [DllImport("TPIHuman.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "MyTurn")] - private extern static int MyTurnH(IntPtr board, int turn, int player); + private extern static int MyTurnH(IntPtr board); static string[] PLAYER_STR = new string[] { "", "先手", "後手" }; @@ -78,10 +78,10 @@ switch (thinkers[(int)ttt.Player - 1]) { case 1: Console.WriteLine(""); - ttt.Set(MyTurnH(ttt.GetBoard(), ttt.Turn, (int)ttt.Player)); + ttt.Set(MyTurnH(ttt.GetBoard())); break; case 2: - ttt.Set(MyTurnR(ttt.GetBoard(), ttt.Turn, (int)ttt.Player)); + ttt.Set(MyTurnR(ttt.GetBoard())); if (!IsHumanR()) Console.WriteLine($" --> {ttt.LastSet + 1}"); break; }