jueves, 31 de marzo de 2011

Ejercicio Programación Random‏


EJERCICIO RANDOM (Rnd())



Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim num1 As Single
Dim num2 As Single
num1 = TextBox1.Text
num2 = CInt(Int((6 * Rnd())) + 1)
TextBox2.Text = CStr(num2)
If (num1 <= num2) Then
textbox3.text = "Perdio"
Else
TextBox3.Text = "Ganó"
End If
End Sub
End Class

No hay comentarios:

Publicar un comentario