Quick actions

cmd+k|ctrl+k

Navigation

Languages

Heist Time

Snippet info

Language

Go

Visibility

public

Author

fizznakle

Created

2020-04-04T19:53:12Z

Updated

2020-04-05T02:34:48Z

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!")
  }

}
INFO