0% found this document useful (0 votes)
31 views19 pages

Reci Ente

1. The document contains code for a memory game program with images that the user clicks on to match. 2. When the user clicks an image, it is compared to another image to check for a match. If matched, the images are hidden. 3. The code checks if all images are hidden, at which point the game is considered complete and a message is displayed to the user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views19 pages

Reci Ente

1. The document contains code for a memory game program with images that the user clicks on to match. 2. When the user clicks an image, it is compared to another image to check for a match. If matched, the images are hidden. 3. The code checks if all images are hidden, at which point the game is considered complete and a message is displayed to the user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Dim counter, seconds As Integer

Dim juegoCompleto As Boolean

Private Sub Command1_Click()

Unload Me

End

End Sub

Private Sub Command2_Click()

MezclarImagenes

End Sub

Private Sub Command3_Click()

Dim temp As Picture

Dim randomlndex As Integer

If randomlnex = 1 Then

Else

Set temp = imgca1.Picture

Set imgca1 = imgsol2.Picture

Set imgsol2.Picture = temp

Set temp = imgca1.Picture

Set imgca1 = imgso2.Picture

Set imgso2.Picture = temp

Set temp = imgca1.Picture

Set imgca1 = imglu2.Picture

Set imglu2.Picture = temp

Set temp = imgca1.Picture


Set imgca1 = imgfl2.Picture

Set imgfl2.Picture = temp

Set temp = imgca1.Picture

Set imgca1 = imgba2.Picture

Set imgba2.Picture = temp

Set temp = imgca1.Picture

Set imgca1 = imgmo2.Picture

Set imgmo2.Picture = temp

Set temp = imgca1.Picture

Set imgca1 = imgce2.Picture

Set imgce2.Picture = temp

Set temp = imgca2.Picture

Set imgca2 = imgce1.Picture

Set imgce1.Picture = temp

Set temp = imgca2.Picture

Set imgca2.Picture = imgca1.Picture

Set imgca1.Picture = temp

Set temp = imgca1.Picture

Set imgca1.Picture = imglu2.Picture

Set imglu2.Picture = temp


End If

End Sub

Private Sub imgca1_Click()

counter = counter + 1

imgca1.Picture = imgca.Picture

If imgca1.Picture = (imgca1.Picture) And imgca2.Picture = (imgca.Picture) Then

imgca1.Visible = False

imgca2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _
imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And
imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgca2_Click()

counter = counter + 1

imgca2.Picture = imgca.Picture

If imgca1.Picture = (imgca.Picture) And imgca2.Picture = (imgca.Picture) Then

imgca1.Visible = False

imgca2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then
juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgce1_Click()

counter = counter + 1

imgce1.Picture = imgce.Picture

If imgce1.Picture = (imgce.Picture) And imgce2.Picture = (imgce.Picture) Then

imgce1.Visible = False

imgce2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If
End Sub

Private Sub imgce2_Click()

counter = counter + 1

imgce2.Picture = imgce.Picture

If imgce1.Picture = (imgce.Picture) And imgce2.Picture = (imgce.Picture) Then

imgce1.Visible = False

imgce2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgfl1_Click()

counter = counter + 1

imgfl1.Picture = imgfl.Picture
If imgfl1.Picture = (imgfl.Picture) And imgfl2.Picture = (imgfl.Picture) Then

imgfl1.Visible = False

imgfl2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgfl2_Click()

counter = counter + 1

imgfl2.Picture = imgfl.Picture

If imgfl1.Picture = (imgfl.Picture) And imgfl2.Picture = (imgfl.Picture) Then

imgfl1.Visible = False

imgfl2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True
End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgba1_Click()

counter = counter + 1

imgba1.Picture = imgba.Picture

If imgba1.Picture = (imgba.Picture) And imgba2.Picture = (imgba.Picture) Then

imgba1.Visible = False

imgba2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _
imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And
imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgba2_Click()

counter = counter + 1

imgba2.Picture = imgba.Picture

If imgba1.Picture = (imgba.Picture) And imgba2.Picture = (imgba.Picture) Then

imgba1.Visible = False

imgba2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then
juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgso1_Click()

counter = counter + 1

imgso1.Picture = imgso.Picture

If imgso1.Picture = (imgso.Picture) And imgso2.Picture = (imgso.Picture) Then

imgso1.Visible = False

imgso2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If
End Sub

Private Sub imgso2_Click()

counter = counter + 1

imgso2.Picture = imgso.Picture

If imgso1.Picture = (imgso.Picture) And imgso2.Picture = (imgso.Picture) Then

imgso1.Visible = False

imgso2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgsol1_Click()

counter = counter + 1

imgsol1.Picture = imgsol.Picture
If imgsol1.Picture = (imgsol.Picture) And imgsol2.Picture = (imgsol.Picture) Then

imgsol1.Visible = False

imgsol2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imglu1_Click()

counter = counter + 1

imglu1.Picture = imglu.Picture

If imglu1.Picture = (imglu.Picture) And imglu2.Picture = (imglu.Picture) Then

imglu1.Visible = False

imglu2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True
End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgmo1_Click()

counter = counter + 1

imgmo1.Picture = imgmo.Picture

If imgmo1.Picture = (imgmo.Picture) And imgmo2.Picture = (imgmo.Picture) Then

imgmo1.Visible = False

imgmo2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _
imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And
imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgmo2_Click()

counter = counter + 1

imgmo2.Picture = imgmo.Picture

If imgmo1.Picture = (imgmo.Picture) And imgmo2.Picture = (imgmo.Picture) Then

imgmo1.Visible = False

imgmo2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then
juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub imgsol2_Click()

counter = counter + 1

imgsol2.Picture = imgsol.Picture

If imgsol1.Picture = (imgsol.Picture) And imgsol2.Picture = (imgsol.Picture) Then

imgsol1.Visible = False

imgsol2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If
End Sub

Private Sub imglu2_Click()

counter = counter + 1

imglu2.Picture = imglu.Picture

If imglu1.Picture = (imglu.Picture) And imglu2.Picture = (imglu.Picture) Then

imglu1.Visible = False

imglu2.Visible = False

ElseIf counter = 2 Then

Timer1.Enabled = True

End If

' Verificar si todas las imágenes están ocultas

If imgca1.Visible = False And imgca2.Visible = False And imgce1.Visible = False And


imgce2.Visible = False And _

imgfl1.Visible = False And imgfl2.Visible = False And imgba1.Visible = False And


imgba2.Visible = False And _

imgso1.Visible = False And imgso2.Visible = False And imglu1.Visible = False And


imglu2.Visible = False And _

imgsol1.Visible = False And imgsol2.Visible = False And imgmo1.Visible = False And


imgmo2.Visible = False Then

juegoCompleto = True ' El juego está completo

' Mostrar el mensaje "Eres un genio"

MsgBox "¡Eres un genio!"

End If

End Sub

Private Sub MezclarImagenes()

counter = 0

seconds = 0
juegoCompleto = False

' Aquí puedes agregar la lógica para mezclar las imágenes nuevamente

' Restaurar las imágenes a su estado inicial

imgca1.Picture = imgestandar.Picture

imgca2.Picture = imgestandar.Picture

imgfl1.Picture = imgestandar.Picture

imgfl2.Picture = imgestandar.Picture

imgba1.Picture = imgestandar.Picture

imgba2.Picture = imgestandar.Picture

imgso1.Picture = imgestandar.Picture

imgso2.Picture = imgestandar.Picture

imglu1.Picture = imgestandar.Picture

imglu2.Picture = imgestandar.Picture

imgsol1.Picture = imgestandar.Picture

imgsol2.Picture = imgestandar.Picture

imgmo1.Picture = imgestandar.Picture

imgmo2.Picture = imgestandar.Picture

imgce1.Picture = imgestandar.Picture

imgce2.Picture = imgestandar.Picture

' Mostrar todas las imágenes

imgca1.Visible = True

imgca2.Visible = True

imgfl1.Visible = True

imgfl2.Visible = True

imgba1.Visible = True

imgba2.Visible = True

imgso1.Visible = True

imgso2.Visible = True
imglu1.Visible = True

imglu2.Visible = True

imgsol1.Visible = True

imgsol2.Visible = True

imgmo1.Visible = True

imgmo2.Visible = True

imgce1.Visible = True

imgce2.Visible = True

Timer1.Enabled = False

lblTemp = 0

End Sub

Private Sub Timer1_Timer()

seconds = seconds + 1

lblTemp = seconds

If seconds = 3 Then

imgca1.Picture = imgestandar.Picture

imgca2.Picture = imgestandar.Picture

imgfl1.Picture = imgestandar.Picture

imgfl2.Picture = imgestandar.Picture

imgba1.Picture = imgestandar.Picture

imgba2.Picture = imgestandar.Picture

imgso1.Picture = imgestandar.Picture

imgso2.Picture = imgestandar.Picture

imglu1.Picture = imgestandar.Picture

imglu2.Picture = imgestandar.Picture

imgsol1.Picture = imgestandar.Picture

imgsol2.Picture = imgestandar.Picture

imgmo1.Picture = imgestandar.Picture
imgmo2.Picture = imgestandar.Picture

imgce1.Picture = imgestandar.Picture

imgce2.Picture = imgestandar.Picture

End If

End If

End Sub

You might also like