-
Module Module1
-
-
Sub Main()
-
-
Jugar()
-
-
End Sub
-
-
Sub Titulo()
-
Console.WriteLine("---------------------------------------")
-
Console.WriteLine("Mosqueta")
-
Console.WriteLine("---------------------------------------")
-
Console.WriteLine()
-
End Sub
-
-
Sub Tablero()
-
Console.WriteLine("1 2 3")
-
Console.WriteLine("O O O")
-
End Sub
-
-
Sub Jugar()
-
Dim ball, opcion, vaso As Short
-
Dim veces_ganadas As Short = 0
-
Dim dinero As Short = 500
-
Dim apuesta As Short
-
Dim Pantalla As New ClearConsole
-
-
Do
-
Pantalla.Clear()
-
Titulo()
-
Tablero()
-
Console.WriteLine()
-
Console.WriteLine("Veces Ganadas: " + CStr(veces_ganadas))
-
Console.WriteLine("Usted tiene: " + CStr(dinero) + " $ de Saldo")
-
Do
-
Console.Write("Cuanto desea apostar? $")
-
apuesta = Console.ReadLine()
-
-
If (apuesta> dinero) Then
-
Console.WriteLine("No puedes apostar mas de lo que tienes")
-
ElseIf (apuesta = 0) Then
-
Console.WriteLine("No puedes apostar 0")
-
End If
-
Loop While (apuesta> dinero Or apuesta = 0)
-
-
Do
-
Console.Write("Seleccione una opcion: ")
-
opcion = Console.ReadLine()
-
-
If (opcion> 3) Then
-
Console.WriteLine("Ingrese una opcion Valida")
-
End If
-
Loop While (opcion> 3)
-
-
Randomize()
-
vaso = Rnd() * 3 + 1
-
-
If (opcion = vaso And veces_ganadas <= 3) Then
-
Console.WriteLine("Ganaste!")
-
Console.WriteLine("Has recibido: " + CStr((apuesta * 2)) + " $")
-
dinero += apuesta * 2
-
veces_ganadas += 1
-
ElseIf (opcion = vaso And veces_ganadas> 3) Then
-
Console.WriteLine("Perdiste! 3 Veces Seguidas no podia ser!")
-
Console.WriteLine("Te han quitado: " + CStr(apuesta * 2) + " $")
-
dinero -= apuesta * 2
-
If (veces_ganadas> 0) Then
-
veces_ganadas -= 1
-
End If
-
Else
-
Console.WriteLine("Perdiste!")
-
Console.WriteLine("Te han quitado: " + CStr(apuesta) + " $")
-
dinero -= apuesta
-
If (veces_ganadas> 0) Then
-
veces_ganadas -= 1
-
End If
-
End If
-
Console.ReadLine()
-
Loop While (dinero>= 0)
-
End Sub
-
End Module