gopher-the-number/lib.go

12 lines
204 B
Go
Raw Normal View History

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