Clarify if the doors are switched

This commit is contained in:
Jesper 2023-02-23 13:01:26 +01:00
parent a4095d77d2
commit 70a38f2123

View File

@ -73,8 +73,13 @@ func main() {
}
}
switchedString := "are"
if !switchDoor {
switchedString = "isn't"
}
// Calculate the winning chance
winningChance := float64(totalWon) / float64(gamesToPlay) * 100.0
fmt.Printf("In %d games\nGames won: %d\nGames Lost: %d\n", gamesToPlay, totalWon, totalLost)
fmt.Printf("This gives you a winning chance of %.2f%% percent\n", winningChance)
fmt.Printf("This gives you a winning chance of %.2f%% percent if the doors %s switched\n", winningChance, switchedString)
}