import random import os c1 = 0 a = ['1', '2', '3'] p = random.choice(a) c2 = 0 c3 = 0 l = 1 while l == 1: a = ['1', '2', '3'] p = random.choice(a) os.system("clear") print "Your Options Are: " print "1) Scissors" print "2) Paper" print "3) Rock" x = raw_input("Make Your Choice: ") if x == p: print "You Win!" if x != p: print "You Lose!" raw_input("Press Enter To Continue") os.system("clear") Code (markup):
This should work better.. (not tested since i don´t have python installed on any of my servers) import random import os while 1 == 1: a = ['1', '2', '3'] p = random.choice(a) os.system("clear") print "Your Options Are: " print "1) Scissors" print "2) Paper" print "3) Rock" print "4) Quit" x = raw_input("Make Your Choice: ") if x == 4: break; if p == 1: if x == 1: print "A Draw!" elif x == 2: print "You Lose!" elif x == 3: print "You Win!" elif p == 2: if x == 1: print "You Win!" elif x == 2: print "A Draw!" elif x == 3: print "You Lose!" elif p == 3: if x == 1: print "You Lose!" elif x == 2: print "You Win!" elif x == 3: print "A Draw!" raw_input("Press Enter To Continue") os.system("clear") PHP: