24 lines
263 B
Go
24 lines
263 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
var read = bufio.NewReader(os.Stdin)
|
||
|
|
||
|
func ReadBool() bool {
|
||
|
ret, _ := read.ReadByte()
|
||
|
switch ret {
|
||
|
case 'y':
|
||
|
fallthrough
|
||
|
case 'Y':
|
||
|
return true
|
||
|
case 'n':
|
||
|
fallthrough
|
||
|
case 'N':
|
||
|
return false
|
||
|
}
|
||
|
return false
|
||
|
}
|