Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#MonthOfCode day 31 - exit
# a dumb game. How to win this?
import random
import time
import sys
t0 = time.time()
while True:
if random.choice((True,False)):
time.sleep(0.13)
else:
time.sleep(0.29)
if random.choice( (True,False,False,False,False,False,False,False,False) ):
print "Program exited! Your score:","%.2f" % (time.time() - t0),"sec. Can you do better?"
sys.exit( 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment