Fixed incorrect ignore file
This commit is contained in:
parent
f67ddb322c
commit
dacf5eec1e
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
||||
golearn
|
||||
guess_number
|
1
guess_number/.gitignore
vendored
Normal file
1
guess_number/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
guess_number
|
35
guess_number/guess_number.go
Normal file
35
guess_number/guess_number.go
Normal file
@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import ("fmt"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main(){
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
var randNumber int = rand.Int()%100
|
||||
|
||||
stuff := true
|
||||
|
||||
for stuff == true{
|
||||
|
||||
fmt.Print("Guess a number between 1 and 100: ")
|
||||
var guess int
|
||||
fmt.Scan(&guess)
|
||||
|
||||
if guess > randNumber{
|
||||
fmt.Println("Too High")
|
||||
|
||||
}else if guess < randNumber{
|
||||
fmt.Print("Too low" + "\n")
|
||||
|
||||
|
||||
}else if guess == randNumber{
|
||||
fmt.Println("Correct")
|
||||
|
||||
}else{
|
||||
fmt.Println("What the fuck")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user