Skip to content

Instantly share code, notes, and snippets.

@wkta wkta/day_31.py
Created Mar 31, 2014

Embed
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.