Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim maxPlays As Integer = 42
- Dim currentPlay As Integer = 0
- Dim validPlay As Boolean = False
- Dim choice As String = String.Empty
- Dim player As String = String.Empty
- Dim column As Integer = 1 To 7
- Do While currentPlay < maxPlays
- If currentPlay Mod 2 = 0 Then
- player = Player1
- choice = choiceNum
- Else
- player = Player2
- choice = choiceNum2
- End If
- Console.WriteLine($"{player} where would you like to place your symbol!")
- Select Case Console.ReadLine
- Case 1
- validPlay = ClaimGrid(6, 1, choice)
- Case 2
- validPlay = ClaimGrid(6, 2, choice)
- Case 3
- validPlay = ClaimGrid(6, 3, choice)
- Case 4
- validPlay = ClaimGrid(6, 4, choice)
- Case 5
- validPlay = ClaimGrid(6, 5, choice)
- Case 6
- validPlay = ClaimGrid(6, 6, choice)
- Case 7
- validPlay = ClaimGrid(6, 7, choice)
- Case Else
- validPlay = False
- End Select
- If validPlay Then
- currentPlay += 1
- Updategamegrid()
- If CheckForWin(choice) Then
- Console.WriteLine("We have a winner!")
- Exit Do
- End If
- Else
- Console.WriteLine("You cannot play there")
- End If
- Loop
- Console.WriteLine("GAME OVER!")
- Console.ReadKey()
- game()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement