Heist Time

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "fmt" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) isHeistOn := true eludedGuards := rand.Intn(100) //STAGE 1 if eludedGuards >=51 { fmt.Println("You evaded the guards.") } else if eludedGuards < 51 { isHeistOn = false fmt.Println("Sorry. The guards found you!") } //STAGE 2 if isHeistOn == true{ openedVault := rand.Intn(100) if openedVault >= 70 { fmt.Println("You opened the vault.") } else if openedVault < 70 { isHeistOn = false fmt.Println("Sorry. The Vault Could not be opened!") } //STAGE 3 leftSafely := rand.Intn(5) if isHeistOn == true { switch leftSafely { case 0: isHeistOn = false fmt.Println ("Sorry. you tripped on the way out!") case 1: isHeistOn = false fmt.Println("Sorry. You couldn't find your way out!") case 2: isHeistOn = false fmt.Println("Sorry. you changed your mind and gave up!") case 3: fmt.Println("you got the FLIP out of there.") case 4: fmt.Println("YOU FUCKING DID IT YOU BITCH.") case 5: fmt.Println("Another success story.") } } } //STAGE 4 if isHeistOn == true { amtStolen := 10000 + rand.Intn(1000000) fmt.Println("amount stolen was:",amtStolen) } if isHeistOn == true { fmt.Println("You completed THE HEIST") }else{ fmt.Print("You were unable to complete THE HEIST. TRY AGAIN!") } }
Editor Settings
Theme
Key bindings
Full width
Lines