Skip to content

Instantly share code, notes, and snippets.

@VTRyo
Created March 15, 2023 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VTRyo/f5c28a94cf826ca91f366b34f4bb43dd to your computer and use it in GitHub Desktop.
Save VTRyo/f5c28a94cf826ca91f366b34f4bb43dd to your computer and use it in GitHub Desktop.
Do you have everything?
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
q1 := "あなたには家族がいますか?"
q2 := "あなたには子どもがいますか?"
q3 := "あなたの住居は持ち家ですか?"
q4 := "あなたは車を持っていますか?"
q5 := "あなたは太い実家を持っていますか?"
q6 := "あなたは社会的信用がありますか?"
reader := bufio.NewReader(os.Stdin)
questions := []string{q1, q2, q3, q4, q5, q6}
for i, q := range questions {
fmt.Printf("%s? (yes/no)", q)
answer, _ := reader.ReadString('\n')
if answer == "no\n" {
fmt.Println("あなたはすべてを持たない者です")
return
}
if i == len(questions)-1 {
fmt.Println("あなたはすべてを持つ者です")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment