-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (34 loc) · 812 Bytes
/
main.go
File metadata and controls
38 lines (34 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"fmt"
"math/rand"
"strconv"
"time"
)
func printText(text string) {
for _, i := range text {
fmt.Print(string(i))
time.Sleep(time.Millisecond * 40)
}
fmt.Print("\n")
}
func main() {
printText("Random bald generator!")
time.Sleep(time.Second)
fmt.Println()
fmt.Println()
var bald [5]int
var res int = 0
for i := range bald {
bald[i] = rand.Intn(100)
res += bald[i]
}
printText("You are " + strconv.Itoa(bald[0]) + "% bald")
printText("Your sister is " + strconv.Itoa(bald[1]) + "% bald")
printText("Your brother is " + strconv.Itoa(bald[2]) + "% bald")
printText("Your dog is " + strconv.Itoa(bald[3]) + "% bald")
printText("Your cat is " + strconv.Itoa(bald[4]) + "% bald")
printText("My rating: " + strconv.Itoa(res) + "%!")
fmt.Println()
fmt.Println()
}