From d62ea2356c51af2c497d83bd2e94de74c01af297 Mon Sep 17 00:00:00 2001 From: janic Date: Thu, 3 Feb 2022 22:57:58 +0100 Subject: [PATCH] Just some Testing --- tutorial.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tutorial.go diff --git a/tutorial.go b/tutorial.go new file mode 100644 index 0000000..2eb5b2a --- /dev/null +++ b/tutorial.go @@ -0,0 +1,37 @@ +package main + +import "fmt" + +func main() { + var firstname string + var lastname string + var age int + + fmt.Println("Welcome to the Quiz game") + fmt.Printf("Enter your firstname and lastname: ") + fmt.Scan(&firstname, &lastname) + fmt.Printf("Enter your age: ") + fmt.Scan(&age) + + if age >= 18 { + fmt.Println("Have fun gambling") + } else { + fmt.Println("You are too young for gambling") + fmt.Printf("You have to wait %v more year(s)", 18-age) + return + } + + fmt.Printf("What is better, 43 or 42") + var answer int + fmt.Scan(&answer) + + if answer == 42 { + fmt.Println("You are right this unlooked the secret") + } else { + fmt.Println("You are wrong") + return + } + + fmt.Println("########### DEBUG ###########") + fmt.Printf("Hello %v %v, you are %v years old\n", firstname, lastname, age) +}