看板 Visual_Basic 關於我們 聯絡資訊
※ 引述《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
yauhh:不是這個意思,宣告的陣列是當作Button的物件參考 05/17 02:16