Skip to content

Instantly share code, notes, and snippets.

@Achifaifa
Last active August 29, 2015 14:04
Show Gist options
  • Save Achifaifa/045f17f70b240b7e4645 to your computer and use it in GitHub Desktop.
Save Achifaifa/045f17f70b240b7e4645 to your computer and use it in GitHub Desktop.
Russian roulette for console. We really needed this.
#!/usr/bin/env bash
import os,random
if __name__=="__main__":
os.system('clear')
bullets=["O","O","O","O","O","O"]
bullets[random.randrange(6)]="X"
raw_input("? ? ? ? ? ?\nGo ahead!")
for i in range(6):
os.system('clear')
for j in range(i+1): print bullets[j],
for j in range(6-i-1): print "?",
if bullets[i]=="O": raw_input("\nClick.")
if bullets[i]=="X": print "\nBANG!";exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment