Just some Testing
This commit is contained in:
parent
fc62fbea0d
commit
d62ea2356c
37
tutorial.go
Normal file
37
tutorial.go
Normal file
@ -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)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user