diff --git a/BlackjackGUI/game.vb b/BlackjackGUI/game.vb index 86c4f42..a12951b 100644 --- a/BlackjackGUI/game.vb +++ b/BlackjackGUI/game.vb @@ -141,35 +141,28 @@ RaiseEvent EndGame(winMessage) End Sub Function GetResults() - If dealer.winType = WinCondition.Blackjack Then - If player.winType = WinCondition.Blackjack Then - Return "Player ties with Blackjack!" - Else - Return "Dealer wins with Blackjack!" - End If - End If - If player.winType = WinCondition.Blackjack Then - Return "Player wins with Blackjack!" - End If - If player.winType = WinCondition.FiveCard Then - Return "Player wins with Five Card Charlie!" - End If - If player.winType = WinCondition.Bust Then - Return "Player busts!" - End If - If dealer.winType = WinCondition.Bust Then - Return "Dealer busts!" - End If - If player.total > dealer.total Then - Return "Player wins with total of " + player.total.ToString() + "!" - End If - If player.total = dealer.total Then - Return "Tie!" - End If - If player.total < dealer.total Then - Return "Dealer wins with total of " + dealer.total.ToString() + "!" - End If - Return "error" + Select Case True + Case dealer.winType = WinCondition.Blackjack + If player.winType = WinCondition.Blackjack Then + Return "Player ties with Blackjack!" + Else + Return "Dealer wins with Blackjack!" + End If + Case player.winType = WinCondition.Blackjack + Return "Player wins with Blackjack!" + Case player.winType = WinCondition.FiveCard + Return "Player wins with Five Card Charlie!" + Case player.winType = WinCondition.Bust + Return "Player busts!" + Case dealer.winType = WinCondition.Bust + Return "Dealer busts!" + Case player.total > dealer.total + Return "Player wins with a total of " & player.total.ToString() & "!" + Case player.total = dealer.total + Return "Tie!" + Case Else + Return "Dealer wins with a total of " & dealer.total.ToString() & "!" + End Select End Function Function CreateDeck() As List(Of Tuple(Of String, String)) Dim response As New List(Of Tuple(Of String, String))