|
分類:[VB.NET/VB2005 以降]
'勝敗判定 If table(0, 0) = "O" And table(0, 1) = "O" And table(0, 2) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(1, 0) = "O" And table(1, 1) = "O" And table(1, 2) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(2, 0) = "O" And table(2, 1) = "O" And table(2, 2) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(0, 0) = "O" And table(1, 0) = "O" And table(2, 0) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(0, 1) = "O" And table(1, 1) = "O" And table(2, 1) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(0, 2) = "O" And table(1, 2) = "O" And table(2, 2) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(0, 0) = "O" And table(1, 1) = "O" And table(2, 2) = "O" Then Gameover = 1 WinPlayer = P1name ElseIf table(0, 2) = "O" And table(1, 1) = "O" And table(2, 0) = "O" Then Gameover = 1 WinPlayer = P1name
ElseIf table(0, 0) = "X" And table(0, 1) = "X" And table(0, 2) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(1, 0) = "X" And table(1, 1) = "X" And table(1, 2) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(2, 0) = "X" And table(2, 1) = "X" And table(2, 2) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(0, 0) = "X" And table(1, 0) = "X" And table(2, 0) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(0, 1) = "X" And table(1, 1) = "X" And table(2, 1) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(0, 2) = "X" And table(1, 2) = "X" And table(2, 2) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(0, 0) = "X" And table(1, 1) = "X" And table(2, 2) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf table(0, 2) = "X" And table(1, 1) = "X" And table(2, 0) = "X" Then Gameover = 1 WinPlayer = P2name ElseIf LoopCount1 > 9 Then Gameover = 2 End If とりあえず、勝敗の全パターンを書きましたが、いまいち配列化?関数化のやり方がわかりません。
|