Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rock Paper Scissors!
#1
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")
Reply
#2
Haha, dude, the stuff you code is awesome Smile
Confused
Reply
#3
he pretty much copy pasted PaNiK's thread =/
[Image: sig.php]
Reply
#4
(10-14-2009, 11:10 AM)Nyx- Wrote: he pretty much copy pasted PaNiK's thread =/

lol

unless your serious Sad
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)