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:
@ -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 {
|
||||||
|
Reference in New Issue
Block a user