| FAQ |
| Calendar |
|
|||||||
| Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman. |
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
agan2....ada yang tau gak...coding untuk tic-tac-toe kalau permainan gak ada yang menang, alias draw/tie/seri
code yang udah gw bikin untuk menang gini: Spoiler for code: Private Sub win() If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button1.Text = "X" And Button5.Text = "X" And Button9.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button3.Text = "X" And Button6.Text = "X" And Button9.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button3.Text = "X" And Button5.Text = "X" And Button7.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button4.Text = "X" And Button5.Text = "X" And Button6.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button7.Text = "X" And Button8.Text = "X" And Button9.Text = "X" Then MsgBox("Player X wins!", MsgBoxStyle.Information) Label3.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button1.Text = "O" And Button2.Text = "O" And Button3.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button1.Text = "O" And Button4.Text = "O" And Button7.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button1.Text = "O" And Button5.Text = "O" And Button9.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button2.Text = "O" And Button5.Text = "O" And Button8.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button3.Text = "O" And Button6.Text = "O" And Button9.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button3.Text = "O" And Button5.Text = "O" And Button7.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button4.Text = "O" And Button5.Text = "O" And Button6.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If If Button7.Text = "O" And Button8.Text = "O" And Button9.Text = "O" Then MsgBox("Player O wins!", MsgBoxStyle.Information) Label4.Text += 1 Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End If End Sub </div> |
![]() |
|
|
Terkait
|
||||
| Thread | Forum | |||
| JUAL Jual eBook VISUAL BASIC [ untuk Programmer ] | Buku Pelajaran | |||
| JUAL Source Code Visual Basic 6.0, Vb-Net, Delphi, Visual Foxpro,Web Bisnis, Java, PHP | Software Original & Open Source | |||
| JUAL CD Tutorial Membuat Game Dengan Visual Basic | Software Original & Open Source | |||
| belajar coding visual basic 6.0 | Programming | |||
| beda visual basic 6.0 - visual basic 2005 - visual basic 2008 - dan visual basic.net? | Programming | |||