Support Forums

Full Version: Rock Paper Scissors!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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")
Haha, dude, the stuff you code is awesome Smile
he pretty much copy pasted PaNiK's thread =/
(10-14-2009, 11:10 AM)Nyx- Wrote: [ -> ]he pretty much copy pasted PaNiK's thread =/

lol

unless your serious Sad