作者xtimer ()
看板Visual_Basic
标题Re: [VB6 ] 井字游戏的胜负判定
时间Sat May 17 01:47:38 2008
※ 引述《xtimer ()》之铭言:
: 我用的是VB2005版本
: 作业是写出一个井字游戏 (OOXX那个~@@)
: 游戏本身我已经写好了
: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
: x = x + 1
: Button1.Enabled = False
: If x Mod 2 = 1 Then
: Button1.Text = "O"
: Else
: Button1.Text = "X"
: End If
: End Sub
: 分别为Button1~9
: 可是要怎麽判别
: 147 258 369 123 456 789 159 357的text相同
: 就跳出一个label说该text玩家赢了呢?
: 恳求提点 谢谢各位
我多放了一个dim win(2, 2)
然後9个按纽依续改成了
x = x + 1
Button1.Enabled = False
If x Mod 2 = 1 Then
Button1.Text = "O"
win(0, 0) = 1
Else
Button1.Text = "X"
win(0, 0) = 2
End If
可是
最後判定要写在哪一个呢 = =?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.143.32.124
1F:推 yauhh:不是这个意思,宣告的阵列是当作Button的物件参考 05/17 02:16