Advertisement
George_Nikou

Scramble game

Oct 14th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Dim rand As New Random
  2. Dim actual As String
  3. Dim word As String
  4.  
  5. word = "enemy"
  6. actual = word
  7.  
  8. Dim shuffledInput As String = word.OrderBy(Function() rand.Next).ToArray
  9. Label1.Text = shuffledInput
  10. If count = 7 Then
  11. MsgBox("Gameover.")
  12. count = 0
  13. ElseIf shuffledInput = word Then
  14. shuffledInput = word.OrderBy(Function() rand.Next).ToArray
  15. Label1.Text = shuffledInput
  16. Else
  17. If TextBox2.Text = word Then
  18. MsgBox("You guessed the word " & word & ".")
  19. count = 0
  20. ListBox1.Items.Clear()
  21. Else
  22. count += 1
  23. MsgBox("Count: " & count)
  24. ListBox1.Items.Add(TextBox2.Text)
  25. End If
  26. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement