gopher-the-number/lib.go

11 lines
204 B
Go

package main
func CheckGuess(guess, random int) (string, bool) {
if guess == random {
return "Good job!", true
}
if random > guess {
return "Try higher.", false
}
return "Nope, lower.", false
}