Raven Posted January 10, 2009 Report Posted January 10, 2009 Public Class Form1 Dim tic As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load tic = 1 End Sub Private Sub win() If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button4.Text = "X" And Button5.Text = "X" And Button6.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button7.Text = "X" And Button8.Text = "X" And Button9.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button3.Text = "X" And Button6.Text = "X" And Button9.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button1.Text = "X" And Button5.Text = "X" And Button9.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True ElseIf Button3.Text = "X" And Button5.Text = "X" And Button7.Text = "X" Then MsgBox("Jucatorul X a castigat!!!!!", MsgBoxStyle.OkCancel) Label6.Text += 1 Button10.Enabled = True End If ' ok acu cu 0 If Button1.Text = "0" And Button2.Text = "0" And Button3.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 Button10.Enabled = True ElseIf Button4.Text = "0" And Button5.Text = "0" And Button6.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 Button10.Enabled = True ElseIf Button7.Text = "0" And Button8.Text = "0" And Button9.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 Button10.Enabled = True ElseIf Button1.Text = "0" And Button4.Text = "0" And Button7.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 Button10.Enabled = True ElseIf Button2.Text = "0" And Button5.Text = "0" And Button8.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 Button10.Enabled = True ElseIf Button3.Text = "0" And Button6.Text = "0" And Button9.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 Button10.Enabled = True ElseIf Button1.Text = "0" And Button5.Text = "0" And Button9.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 ElseIf Button3.Text = "0" And Button5.Text = "0" And Button7.Text = "0" Then MsgBox("Jucatorul 0 a castigat!!!!!", MsgBoxStyle.OkCancel) Label7.Text += 1 ElseIf Button1.Text = "X" And Button2.Text = "0" And Button3.Text = "X" Then MsgBox("Remiza") End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If tic = 1 Then Button1.Text = "0" Label2.Text = "X" Else Button1.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If tic = 1 Then Button2.Text = "0" Label2.Text = "X" Else Button2.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If tic = 1 Then Button3.Text = "0" Label2.Text = "X" Else Button3.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click If tic = 1 Then Button4.Text = "0" Label2.Text = "X" Else Button4.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click If tic = 1 Then Button5.Text = "0" Label2.Text = "X" Else Button5.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click If tic = 1 Then Button6.Text = "0" Label2.Text = "X" Else Button6.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If tic = 1 Then Button7.Text = "0" Label2.Text = "X" Else Button7.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click If tic = 1 Then Button8.Text = "0" Label2.Text = "X" Else Button8.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If tic = 1 Then Button9.Text = "0" Label2.Text = "X" Else Button9.Text = "X" Label2.Text = "0" End If tic += 1 If tic > 2 Then tic = 1 End If Call win() End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click Button1.Text = "" Button2.Text = "" Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End Sub Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click MsgBox("Joc creat de Raven") Form2.Show() End Sub Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click Label6.Text = "0" Label7.Text = "0" End SubEnd ClassAutor : EuDownload Source code: http://rapidshare.com/files/182075755/X_and_Zer0.rar.html Quote
noidee Posted January 10, 2009 Report Posted January 10, 2009 Functia win() e criminala. Daca faceai X si 0 pe o tabla de dimensiunea 10 nu cred ca o terminai. Nu era mai simplu sa salvezi clickurile intr-o matrice? Cu doua while-uri si un if faceai tot ce ai scris tu acolo. tic += 1 If tic > 2 Then tic = 1If-ul ala e aiurea. Fie pui j=!jfiej^=1Si, daca tot e sa faci ceva, fa-l ca userul sa aibe posibilitatea sa joace cu PC-ul.http://en.wikipedia.org/wiki/Minimax Quote
Raven Posted January 10, 2009 Author Report Posted January 10, 2009 Mersi pentru sugesti man .Maine fac jocul single player. Quote
noidee Posted January 10, 2009 Report Posted January 10, 2009 Mersi pentru sugesti man .Maine fac jocul single player.la x si 0 pe o tabla de 3x3 e suficient doua miscari inainte Quote
_nobodY_ Posted February 10, 2009 Report Posted February 10, 2009 raven linku de source code...pune si tu pe www.2shared.com ca nu mere pe rapidshare Quote
cmiN Posted February 10, 2009 Report Posted February 10, 2009 @nobody: Ori codul din arhiva ori codul care l-a postat sigur e acelasi =).@ "Eu": Gj Quote
_nobodY_ Posted February 10, 2009 Report Posted February 10, 2009 am crezut ca ii project1 , form1 ...... Quote
Raven Posted February 10, 2009 Author Report Posted February 10, 2009 am crezut ca ii project1 , form1 ......Asa ii .... Download : http://www.2shared.com/file/4854537/c7f485f5/X_and_Zer0.html Quote
_nobodY_ Posted February 10, 2009 Report Posted February 10, 2009 Asa ii .... Download : http://www.2shared.com/file/4854537/c7f485f5/X_and_Zer0.htmlMersi frate vad ca tu ai inteles (ala cred ca o crezut ca ii .txt) Quote