C# と VB.NET の質問掲示板

わんくま同盟

ASP.NET、C++/CLI、Java 何でもどうぞ

C# と VB.NET の入門サイト


(過去ログ 160 を表示中)
■92654 / )  三目並べ 関数化
□投稿者/ aiti (2回)-(2019/10/18(Fri) 10:30:44)

分類:[.NET 全般] 

同じ処理が何度も続くので短くまとめたいのですが、やり方がわかりません。
Select Case Cursor
Case 1
If table(0, 0) = " " Then
table(0, 0) = Mark
LoopCount1 += 1
End If
Case 2
If table(0, 1) = " " Then
table(0, 1) = Mark
LoopCount1 += 1
End If
Case 3
If table(0, 2) = " " Then
table(0, 2) = Mark
LoopCount1 += 1
End If
Case 4
If table(1, 0) = " " Then
table(1, 0) = Mark
LoopCount1 += 1
End If
Case 5
If table(1, 1) = " " Then
table(1, 1) = Mark
LoopCount1 += 1
End If
Case 6
If table(1, 2) = " " Then
table(1, 2) = Mark
LoopCount1 += 1
End If
Case 7
If table(2, 0) = " " Then
table(2, 0) = Mark
LoopCount1 += 1
End If
Case 8
If table(2, 1) = " " Then
table(2, 1) = Mark
LoopCount1 += 1
End If
Case 9
If table(2, 2) = " " Then
table(2, 2) = Mark
LoopCount1 += 1
End If
End Select

返信 編集キー/


管理者用

- Child Tree -