Update: change the solution to follow instrucion

The exercise restriction says, "Do not make the game too easy. Only adjust the difficulty if the guess is above 10."
This commit is contained in:
AminBhr
2021-09-27 02:20:59 +03:30
committed by İnanç Gümüş
parent 19a495499e
commit 5ba12125ed

View File

@ -49,8 +49,13 @@ func main() {
fmt.Println("Please pick a positive number.") fmt.Println("Please pick a positive number.")
return return
} }
var balancer int
if guess > 10 {
balancer = guess / 4
}
for turn := maxTurns + guess/4; turn > 0; turn-- { for turn := maxTurns + balancer; turn > 0; turn-- {
n := rand.Intn(guess) + 1 n := rand.Intn(guess) + 1
if n == guess { if n == guess {