Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim x, c As Integer
- Dim s As String
- MsgBox("Gissa talet mellan 1 och 100")
- Randomize()
- x = Int(Rnd() * 100) + 1
- start:
- For i = 0 To 5
- c = InputBox("Gissa talet")
- If c = x Then
- MsgBox("Du har gissat rätt")
- GoTo slut
- ElseIf c < x Then
- MsgBox("Du gissade för lågt")
- ElseIf c > x Then
- MsgBox("Du gissade för högt")
- End If
- Next i
- MsgBox("Du har gissat 6 gånger")
- slut:
- s = InputBox("Vill du spela igen? (J/N)")
- s = UCase(s)
- If s = "J" Then
- GoTo start
- Else
- Close()
- End If
- End Sub
- End Class
Add Comment
Please, Sign In to add comment