Skip to content

Instantly share code, notes, and snippets.

@marduk191
Last active April 5, 2016 10:36
Show Gist options
  • Save marduk191/906839bd0f5cfc69d92cbb8b11fe173a to your computer and use it in GitHub Desktop.
Save marduk191/906839bd0f5cfc69d92cbb8b11fe173a to your computer and use it in GitHub Desktop.
Russian roulette
#!/bin/bash
## Russian Roulette
## By marduk191
## email: [email protected]
#comment these out if you use an external list below
#live[0]="You live bitch!"
#live[1]="You haven't died YET!"
#live[2]="Still alive asshole!..."
#died[0]="HAHAHAHAH, you died!"
#died[1]="BOOM!, Took one to the dome!"
#died[2]="COOL!, Your brain splattered on the wall behind you!"
#use mapfile to use external lists for live/die
#be sure to modify atimer to match the number of lines in the list
mapfile -t live < live
mapfile -t died < died
#randomness of gun
dtimer=" $RANDOM % 2 "
# the number of lines in list to make random
atimer=" $RANDOM % 45 "
#Game engine
[ $[ $dtimer ] == 0 ] && echo ${died[$atimer]} || echo ${live[$atimer]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment