-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoneyHeist.go
52 lines (46 loc) · 1.18 KB
/
moneyHeist.go
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"fmt"
"math/rand"
"time"
)
func moneyHeist() {
rand.Seed(time.Now().UnixNano())
isHeistOn := true
eludedGuards := rand.Intn(100)
//leftSafely := rand.Intn(5)
if eludedGuards >= 50 {
fmt.Println("Looks like you've managed to make it past the guards. Good job, but remeber, this is the first step")
} else if isHeistOn := false; isHeistOn {
fmt.Println("Plan a better disguise next time?")
}
openedVault := rand.Intn(100)
if isHeistOn == true && openedVault >= 70 {
fmt.Println("Grab and GO!")
} else if isHeistOn := false; isHeistOn {
fmt.Println("Vault can't be opened")
}
fmt.Println(isHeistOn)
leftSafely := rand.Intn(5)
if isHeistOn == true {
switch leftSafely {
case 0:
isHeistOn = false
fmt.Println("Heist failed!")
case 1:
isHeistOn = false
fmt.Println("Turns out vault doors don't open from the inside")
case 2:
isHeistOn = false
fmt.Println("Better luck next time!")
default:
fmt.Println("Start the getaway car!")
}
amtStole := 10000 + rand.Intn(1000000)
if isHeistOn == true {
fmt.Println(amtStole)
} else {
fmt.Println("Vault can't be opened")
}
}
}