In this part of the code, you refer to the boundary for rand.Intn should be min. If it is min then the max generated number will be from [0, min) + 1, meaning that the guess which is > min will not be taken into count.
My understanding is it should be:
max := guess
if guess1 > max {
max = guess1
}
This way we will evaluate against both guess and guess1.
In this part of the code, you refer to the boundary for
rand.Intnshould be min. If it is min then the max generated number will be from [0, min) + 1, meaning that the guess which is > min will not be taken into count.My understanding is it should be:
This way we will evaluate against both guess and guess1.
learngo/13-loops/exercises/08-lucky-number-exercises/03-double-guesses/solution/main.go
Line 62 in e366d1a