Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. Dim maxPlays As Integer = 42
  2. Dim currentPlay As Integer = 0
  3. Dim validPlay As Boolean = False
  4. Dim choice As String = String.Empty
  5. Dim player As String = String.Empty
  6. Dim column As Integer = 1 To 7
  7.  
  8. Do While currentPlay < maxPlays
  9. If currentPlay Mod 2 = 0 Then
  10. player = Player1
  11. choice = choiceNum
  12. Else
  13. player = Player2
  14. choice = choiceNum2
  15. End If
  16.  
  17. Console.WriteLine($"{player} where would you like to place your symbol!")
  18.  
  19. Select Case Console.ReadLine
  20. Case 1
  21. validPlay = ClaimGrid(6, 1, choice)
  22. Case 2
  23. validPlay = ClaimGrid(6, 2, choice)
  24. Case 3
  25. validPlay = ClaimGrid(6, 3, choice)
  26. Case 4
  27. validPlay = ClaimGrid(6, 4, choice)
  28. Case 5
  29. validPlay = ClaimGrid(6, 5, choice)
  30. Case 6
  31. validPlay = ClaimGrid(6, 6, choice)
  32. Case 7
  33. validPlay = ClaimGrid(6, 7, choice)
  34. Case Else
  35. validPlay = False
  36. End Select
  37.  
  38. If validPlay Then
  39. currentPlay += 1
  40. Updategamegrid()
  41. If CheckForWin(choice) Then
  42. Console.WriteLine("We have a winner!")
  43. Exit Do
  44. End If
  45. Else
  46. Console.WriteLine("You cannot play there")
  47. End If
  48. Loop
  49. Console.WriteLine("GAME OVER!")
  50. Console.ReadKey()
  51. game()
  52. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement