1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

Ajuda urgente no jogo da forca!

Discussão em 'Programação' iniciada por AndreVSerafim, 17 de Março de 2007. (Respostas: 0; Visualizações: 1224)

  1. AndreVSerafim

    AndreVSerafim Power Member

    Boas pessoal eu ainda sou um pouco noob a trabalhar com visual basic mas ja tenho um projecto pa escola que é fazer o jogo da forca, tenho que o entregar ate 2feira e agora encalhei numa parte que nao consigo resolver de maneira nehuma! :005: Sera que alguem me pode ajudar? O meu problema esta em fazer o modo de 2 jogadores e em fazer random as palavras...
    Vou vos deixar aqui o codigo que tenho ate agora mas se alguem precisar de mais alguma coisa podem me adicionar no mail [email protected] assim e mais facil de vos mandar o que tenho e voces verem!

    Código:
    
    -----------------------------------------menu----------------------------------------------
    Public Class Form1
        Public jgd, b, l As Integer
        Dim i As Integer
        Public v As String
    
        Private Sub pai()
            Static jgd As Integer
            Dim pai(0 To 10) As String
            Dim c, a As Integer
    
            pai(1) = "ESPANHA"
            pai(2) = "ANGOLA"
            pai(3) = "BRAZIL"
            pai(4) = "FRANCA"
            pai(5) = "RUSSIA"
            pai(6) = "PORTUGAL"
            pai(7) = "DINAMARCA"
            pai(8) = "ROMENIA"
            pai(9) = "AMERICA"
            pai(10) = "ITALIA"
            Randomize()
            c = Int((Rnd() * 9) + 1)
            v = pai(c)
            a = Len(v)
            For i = 1 To a
                form2.le.Text = form2.le.Text + "_"
                form2.Label1.Text = ("A palavra tem " & Val(a) & " letras")
    
            Next
    
            form2.Show()
    
    
    
        End Sub
        Private Sub SaidaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaidaToolStripMenuItem.Click
            End
        End Sub
    
        Private Sub PaisesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaisesToolStripMenuItem.Click
            pai()
            form2.Show()
    
        End Sub
    
        Private Sub CidadesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CidadesToolStripMenuItem.Click
            Dim cidades(0 To 10) As String
            Dim c, a As Integer
            Dim v As String
            cidades(1) = "Coimbra"
            cidades(2) = "Faro"
            cidades(3) = "Leiria"
            cidades(4) = "Bragança"
            cidades(5) = "Setúbal"
            cidades(6) = "Braga"
            cidades(7) = "Covilhã"
            cidades(8) = "Porto"
            cidades(9) = "Lisboa"
            cidades(10) = "Serpa"
            Randomize()
            c = Int((Rnd() * 9) + 1)
            v = cidades(c)
            a = Len(v)
            For i = 1 To a
                form2.le.Text = form2.le.Text + "_"
                form2.Label1.Text = ("A palavra tem " & Val(a) & " letras")
            Next
            form2.Label2.Text = v
    
            form2.Show()
    
        End Sub
    
        Private Sub AnimaisToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnimaisToolStripMenuItem.Click
            Dim ani(0 To 10) As String
            Dim c, a As Integer
            Dim v As String
            ani(1) = "cão"
            ani(2) = "Ovelha"
            ani(3) = "Crocodilo"
            ani(4) = "Cobra"
            ani(5) = "Cavalo"
            ani(6) = "Rã"
            ani(7) = "Coruja"
            ani(8) = "Passaro"
            ani(9) = "Lontra"
            ani(10) = "Cabrito"
            Randomize()
            c = Int((Rnd() * 9) + 1)
            v = ani(c)
            a = Len(v)
            For i = 1 To a
                form2.le.Text = form2.le.Text + " _ "
                form2.Label1.Text = ("A palavra tem " & Val(a) & " letras")
            Next
            form2.Label2.Text = v
            form2.Show()
    
        End Sub
    
        Private Sub AjudaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AjudaToolStripMenuItem.Click
            MsgBox("dslg")
        End Sub
    
        Private Sub PaisesToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaisesToolStripMenuItem1.Click
            Dim pai(0 To 10) As String
            Dim c, a As Integer
            Dim v As String
            pai(1) = "Espanha"
            pai(2) = "Angola"
            pai(3) = "Brazil"
            pai(4) = "França"
            pai(5) = "Russia"
            pai(6) = "Portugal"
            pai(7) = "Dinamarca"
            pai(8) = "Roménia"
            pai(9) = "América"
            pai(10) = "Itália"
            Randomize()
            c = Int((Rnd() * 9) + 1)
            v = pai(c)
            a = Len(v)
            For i = 1 To a
                form2.le.Text = form2.le.Text + "_"
                form2.Label1.Text = ("A palavra tem " & Val(a) & " letras")
            Next
            form2.Label2.Text = v
    
    
            form2.Show()
    
        End Sub
    
        Private Sub CidadesPortuguêsasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CidadesPortuguêsasToolStripMenuItem.Click
            Dim cidades(0 To 10) As String
            Dim c, a As Integer
            Dim v As String
            cidades(1) = "Coimbra"
            cidades(2) = "Faro"
            cidades(3) = "Leiria"
            cidades(4) = "Bragança"
            cidades(5) = "Setúbal"
            cidades(6) = "Braga"
            cidades(7) = "Covilhã"
            cidades(8) = "Porto"
            cidades(9) = "Lisboa"
            cidades(10) = "Serpa"
            Randomize()
            c = Int((Rnd() * 9) + 1)
            v = cidades(c)
            a = Len(v)
            For i = 1 To a
                form2.le.Text = form2.le.Text + "_"
                form2.Label1.Text = ("A palavra tem " & Val(a) & " letras")
            Next
            form2.Label2.Text = v
    
            form2.Show()
    
        End Sub
    
        Private Sub AnimaisToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnimaisToolStripMenuItem1.Click
            Dim ani(0 To 10) As String
            Dim c, a As Integer
            Dim v As String
            ani(1) = "cão"
            ani(2) = "Ovelha"
            ani(3) = "Crocodilo"
            ani(4) = "Cobra"
            ani(5) = "Cavalo"
            ani(6) = "Rã"
            ani(7) = "Coruja"
            ani(8) = "Passaro"
            ani(9) = "Lontra"
            ani(10) = "Cabrito"
            Randomize()
            c = Int((Rnd() * 9) + 1)
            v = ani(c)
            a = Len(v)
            For i = 1 To a
                form2.le.Text = form2.le.Text + "_"
                form2.Label1.Text = ("A palavra tem " & Val(a) & " letras")
            Next
            form2.Label2.Text = v
    
            form2.Show()
        End Sub
    End Class
    --------------------------------------------------------------------------------------------
    -----------------------------------------form2----------------------------------------------
    Public Class form2
        Public b, p, i, v As Integer
        Dim d
        Dim a, j As String
        Dim c() As Char
    
        Private Sub button1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Button1.Enabled = False
            For i = 0 To Len(a) - 1
                If Button1.Text = a(i) Then
                    c(i) = Button1.Text
                End If
            Next
    
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Button2.Enabled = False
            For i = 0 To Len(a) - 1
                If Button2.Text = a(i) Then
                    c(i) = Button2.Text
    
    
                End If
            Next
            le.Text = c
    
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Button3.Enabled = False
            For i = 0 To Len(a) - 1
                If Button3.Text = a(i) Then
                    c(i) = Button3.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
            Button4.Enabled = False
            For i = 0 To Len(a) - 1
                If Button4.Text = a(i) Then
                    c(i) = Button4.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
            Button5.Enabled = False
            For i = 0 To Len(a) - 1
                If Button5.Text = a(i) Then
                    c(i) = Button5.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
            Button6.Enabled = False
            For i = 0 To Len(a) - 1
                If Button6.Text = a(i) Then
                    c(i) = Button6.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
            Button7.Enabled = False
            For i = 0 To Len(a) - 1
                If Button7.Text = a(i) Then
                    c(i) = Button7.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
            Button8.Enabled = False
            For i = 0 To Len(a) - 1
                If Button8.Text = a(i) Then
                    c(i) = Button8.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
            Button9.Enabled = False
            For i = 0 To Len(a) - 1
                If Button9.Text = a(i) Then
                    c(i) = Button9.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
    
        End Sub
    
        Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
            Button10.Enabled = False
            For i = 0 To Len(a) - 1
                If Button10.Text = a(i) Then
                    c(i) = Button10.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
            Button11.Enabled = False
            For i = 0 To Len(a) - 1
                If Button11.Text = a(i) Then
                    c(i) = Button11.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
            Button12.Enabled = False
            For i = 0 To Len(a) - 1
                If Button12.Text = a(i) Then
                    c(i) = Button12.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
            Button13.Enabled = False
            For i = 0 To Len(a) - 1
                If Button13.Text = a(i) Then
                    c(i) = Button13.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
            Button14.Enabled = False
            For i = 0 To Len(a) - 1
                If Button14.Text = a(i) Then
                    c(i) = Button14.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
            Button15.Enabled = False
            For i = 0 To Len(a) - 1
                If Button15.Text = a(i) Then
                    c(i) = Button15.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
            Button16.Enabled = False
            For i = 0 To Len(a) - 1
                If Button16.Text = a(i) Then
                    c(i) = Button16.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
            Button17.Enabled = False
            For i = 0 To Len(a) - 1
                If Button17.Text = a(i) Then
                    c(i) = Button17.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
            Button18.Enabled = False
            For i = 0 To Len(a) - 1
                If Button18.Text = a(i) Then
                    c(i) = Button18.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
            Button19.Enabled = False
            For i = 0 To Len(a) - 1
                If Button19.Text = a(i) Then
                    c(i) = Button19.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
            Button20.Enabled = False
            For i = 0 To Len(a) - 1
                If Button20.Text = a(i) Then
                    c(i) = Button20.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
            Button21.Enabled = False
            For i = 0 To Len(a) - 1
                If Button21.Text = a(i) Then
                    c(i) = Button21.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
            Button22.Enabled = False
            For i = 0 To Len(a) - 1
                If Button22.Text = a(i) Then
                    c(i) = Button22.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
            
        End Sub
    
        Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
            Button23.Enabled = False
            For i = 0 To Len(a) - 1
                If Button23.Text = a(i) Then
                    c(i) = Button23.Text
    
    
                End If
            Next
            le.Text = c
            If c = a Then
                lpont.Text = Val(lpont.Text) + 1
                d = MsgBox("Ganhou! Quer continuar?", MsgBoxStyle.YesNo, "Ganhou!")
    
                If d = vbNo Then
                    Me.Close()
                Else
                    Button1.Enabled = True
                    Button2.Enabled = True
                    Button3.Enabled = True
                    Button4.Enabled = True
                    Button5.Enabled = True
                    Button6.Enabled = True
                    Button7.Enabled = True
                    Button8.Enabled = True
                    Button9.Enabled = True
                    Button10.Enabled = True
                    Button11.Enabled = True
                    Button12.Enabled = True
                    Button13.Enabled = True
                    Button14.Enabled = True
                    Button15.Enabled = True
                    Button16.Enabled = True
                    Button17.Enabled = True
                    Button18.Enabled = True
                    Button19.Enabled = True
                    Button20.Enabled = True
                    Button21.Enabled = True
                    Button22.Enabled = True
                    Button23.Enabled = True
                    le.Text = ""
                End If
            End If
        End Sub
    
        Private Sub SaidaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaidaToolStripMenuItem.Click
            End
        End Sub
    
        Private Sub form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            a = Form1.v
            c = le.Text
        End Sub
    End Class
    --------------------------------------------------------------------------------------------
    
    
    Bem pessoal isso e tudo o que tenho por agora...mas nao consigo fazer mais, tou mesmo a entrar em desespero! Se alguem me puder ajudar agradecia muito :) Fico a espera de respostas!
     
    Última edição pelo moderador: 17 de Março de 2007

Partilhar esta Página