reproductor





lunes, 5 de marzo de 2012

Bingo

Public Class Form1
Dim n(0 To 4, 0 To 4)
Dim pos As Integer
Dim letra As String
Dim num As Integer


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bingo()

End Sub
Sub bingo()
For col = 0 To 4
For fil = 0 To 4
Randomize()
pos = (1 + Rnd() * 99)
num = 1 + Rnd() * 5
If num = 1 Then
letra = "B"
ElseIf num = 2 Then
letra = "I"
ElseIf num = 3 Then
letra = "N"
ElseIf num = 4 Then
letra = "G"
ElseIf num = 5 Then
letra = "O"
End If

n(col, fil) = letra & pos

Next
Next
For fil = 0 To 4
ListBox1.Items.Add(n(0, fil))
Next

End Sub
End Class

No hay comentarios:

Publicar un comentario