I'm making a program in Go for guessing a random number. I'm having issues with a for loop.
- I can't stop the for loop from continuously iterating.
-
How do i break out of the loop once a condition is satisfied.
for loop == true { //fmt.Println("read number", i, "/n") if i == ans { fmt.Println("well done") } if i != ans { fmt.Println("Nope") fmt.Scan(i) }