gopher-the-number/lib/lib.go

12 lines
203 B
Go
Raw Normal View History

2023-03-15 17:09:26 +01:00
package lib
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
}