Support Forums
Rock Paper Scissors! - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32)
+---- Thread: Rock Paper Scissors! (/showthread.php?tid=1357)



Rock Paper Scissors! - nevets04 - 10-12-2009

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")



RE: Rock Paper Scissors! - Pins222 - 10-13-2009

Haha, dude, the stuff you code is awesome Smile


RE: Rock Paper Scissors! - Nyx- - 10-14-2009

he pretty much copy pasted PaNiK's thread =/


RE: Rock Paper Scissors! - nevets04 - 10-14-2009

(10-14-2009, 11:10 AM)Nyx- Wrote: he pretty much copy pasted PaNiK's thread =/

lol

unless your serious Sad