10-12-2009, 07:36 PM
Code:
import random
import os
c1 = 0
a = ['rock', 'paper', 'scissors']
p = random.choice(a)
c2 = 0
c3 = 0
l = 1
while l == 1:
a = ['rock', 'paper', 'scissors']
p = random.choice(a)
os.system("clear")
print "Your Options Are: "
print "scissors"
print "paper"
print "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")
EDIT: Made it so you can use 1,2, and 3 to pick rock, paper, or scissors instead of typing it.
Code:
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")