Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # deductivelogicgame.py
- from random import *
- from time import *
- sss = [chr(z+64) for z in range(1,27)]
- qqq = "Select a letter from the following -> "
- pts = [0, 0.25, 1, 2, 5]
- def action():
- seed(123123)
- shuffle(sss)
- seed(time())
- for score in range(1,101):
- ttt = sss[:]
- shuffle(ttt)
- print "Round: "+str(score)
- print
- c=0
- for z in range(1,4):
- round = ttt[:5]
- ttt = ttt[5:]
- print "Part "+str(z)+" Out Of 3 --"
- while 1:
- ans = raw_input(qqq+str(round)+" ::: ").strip().upper()
- if ans in round:
- round.sort(key=lambda x: sss.index(x))
- c+=pts[round.index(ans)]
- break
- else:
- print "That entry is invalid..."
- print
- if c > 7 or c > 1 + (score * 0.25):
- print "You managed to score enough points to pass that round. Onto the next..."
- else:
- print "Unfortunately... you did not score enough points to pass that round."
- print "Score: "+str(score-1)
- print "\nGame Over\n\n"
- return
- while 1:
- action()
- ans = raw_input("Play Again? (Y/N): ").strip().upper()
- if 'N' in ans: break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement