total trash
Master
3,372 posts
3,394
Seen 14th March 2016
3rd August 2015, 02:58 PM
Sr PeTaL wrote on 2nd August 2015 02:58 PM:
Rock Paper Scissors
Ok, this is going to be simple and straight forward, it's a rock, paper scissors script I made for fun in python, you can mess around with this and it's really easy just did it to burn some time.
Just go to this link to run it V:
https://trinket.io/python/e8631e4fb5?outputOnly=true
here's the code
Regular Version:
import random;
import time;
def rps():
print ("Welcome to Rock, Paper, and scissors..\n")
time.sleep(1)
playerC = raw_input("What is your choice? ")
if (playerC != "rock" and playerC != "paper" and playerC != "scissors"):
print('Invalid Choice')
exit()
else:
pass
computerC = random.randint(0, 2)
if (computerC == 0):
computerC = "rock"
elif (computerC == 1):
computerC = "paper"
elif (computerC == 2):
computerC = "scissors"
if(computerC == playerC):
print('Tie! Restarting again')
time.sleep(1)
rps()
if(computerC == "rock" and playerC == "paper"):
print('You did it! You won, Congratulations!')
exit()
if(computerC == "rock" and playerC == "scissors"):
print('You lost! You failed your mission to save your people! Over reacting, sorry!')
exit()
if(computerC == "paper" and playerC == "rock"):
print('You lost! Bye bye!')
exit()
if(computerC == "paper" and playerC == "scissors"):
print('You won! Congrats, say something to the camera!')
camera = raw_input()
print("Well! " + camera + " to you too!")
time.sleep(5)
exit()
if(computerC == "scissors" and playerC == "rock"):
print("You won! Congrats brave knight!")
exit()
if(computerC == "scissors" and playerC == "paper"):
print("You sadly lost! You fought well though ")
exit()
Ok, this is going to be simple and straight forward, it's a rock, paper scissors script I made for fun in python, you can mess around with this and it's really easy just did it to burn some time.
Just go to this link to run it V:
https://trinket.io/python/e8631e4fb5?outputOnly=true
here's the code
Regular Version:
import random;
import time;
def rps():
print ("Welcome to Rock, Paper, and scissors..\n")
time.sleep(1)
playerC = raw_input("What is your choice? ")
if (playerC != "rock" and playerC != "paper" and playerC != "scissors"):
print('Invalid Choice')
exit()
else:
pass
computerC = random.randint(0, 2)
if (computerC == 0):
computerC = "rock"
elif (computerC == 1):
computerC = "paper"
elif (computerC == 2):
computerC = "scissors"
if(computerC == playerC):
print('Tie! Restarting again')
time.sleep(1)
rps()
if(computerC == "rock" and playerC == "paper"):
print('You did it! You won, Congratulations!')
exit()
if(computerC == "rock" and playerC == "scissors"):
print('You lost! You failed your mission to save your people! Over reacting, sorry!')
exit()
if(computerC == "paper" and playerC == "rock"):
print('You lost! Bye bye!')
exit()
if(computerC == "paper" and playerC == "scissors"):
print('You won! Congrats, say something to the camera!')
camera = raw_input()
print("Well! " + camera + " to you too!")
time.sleep(5)
exit()
if(computerC == "scissors" and playerC == "rock"):
print("You won! Congrats brave knight!")
exit()
if(computerC == "scissors" and playerC == "paper"):
print("You sadly lost! You fought well though ")
exit()
Does it cost money to use the site?
jdg
Member
1,404 posts
2,110
Seen 10th August 2023
3rd August 2015, 03:06 PM
Allie wrote on 3rd August 2015 02:58 PM:
Sr PeTaL said on 2nd August 2015 02:58 PM:
Rock Paper Scissors
Ok, this is going to be simple and straight forward, it's a rock, paper scissors script I made for fun in python, you can mess around with this and it's really easy just did it to burn some time.
Just go to this link to run it V:
https://trinket.io/python/e8631e4fb5?outputOnly=true
here's the code
Regular Version:
import random;
import time;
def rps():
print ("Welcome to Rock, Paper, and scissors..\n")
time.sleep(1)
playerC = raw_input("What is your choice? ")
if (playerC != "rock" and playerC != "paper" and playerC != "scissors"):
print('Invalid Choice')
exit()
else:
pass
computerC = random.randint(0, 2)
if (computerC == 0):
computerC = "rock"
elif (computerC == 1):
computerC = "paper"
elif (computerC == 2):
computerC = "scissors"
if(computerC == playerC):
print('Tie! Restarting again')
time.sleep(1)
rps()
if(computerC == "rock" and playerC == "paper"):
print('You did it! You won, Congratulations!')
exit()
if(computerC == "rock" and playerC == "scissors"):
print('You lost! You failed your mission to save your people! Over reacting, sorry!')
exit()
if(computerC == "paper" and playerC == "rock"):
print('You lost! Bye bye!')
exit()
if(computerC == "paper" and playerC == "scissors"):
print('You won! Congrats, say something to the camera!')
camera = raw_input()
print("Well! " + camera + " to you too!")
time.sleep(5)
exit()
if(computerC == "scissors" and playerC == "rock"):
print("You won! Congrats brave knight!")
exit()
if(computerC == "scissors" and playerC == "paper"):
print("You sadly lost! You fought well though ")
exit()
Does it cost money to use the site?
Rock Paper Scissors
Ok, this is going to be simple and straight forward, it's a rock, paper scissors script I made for fun in python, you can mess around with this and it's really easy just did it to burn some time.
Just go to this link to run it V:
https://trinket.io/python/e8631e4fb5?outputOnly=true
here's the code
Regular Version:
import random;
import time;
def rps():
print ("Welcome to Rock, Paper, and scissors..\n")
time.sleep(1)
playerC = raw_input("What is your choice? ")
if (playerC != "rock" and playerC != "paper" and playerC != "scissors"):
print('Invalid Choice')
exit()
else:
pass
computerC = random.randint(0, 2)
if (computerC == 0):
computerC = "rock"
elif (computerC == 1):
computerC = "paper"
elif (computerC == 2):
computerC = "scissors"
if(computerC == playerC):
print('Tie! Restarting again')
time.sleep(1)
rps()
if(computerC == "rock" and playerC == "paper"):
print('You did it! You won, Congratulations!')
exit()
if(computerC == "rock" and playerC == "scissors"):
print('You lost! You failed your mission to save your people! Over reacting, sorry!')
exit()
if(computerC == "paper" and playerC == "rock"):
print('You lost! Bye bye!')
exit()
if(computerC == "paper" and playerC == "scissors"):
print('You won! Congrats, say something to the camera!')
camera = raw_input()
print("Well! " + camera + " to you too!")
time.sleep(5)
exit()
if(computerC == "scissors" and playerC == "rock"):
print("You won! Congrats brave knight!")
exit()
if(computerC == "scissors" and playerC == "paper"):
print("You sadly lost! You fought well though ")
exit()
Does it cost money to use the site?
- "Behind this mask there is more than just flesh. Beneath this mask there is an idea... and ideas are bulletproof." -V
Veteran
Master
3,526 posts
9,634
Seen 31st August 2023
3rd August 2015, 06:02 PM
Seems like a lot of you are confused.
Python is a programming language used to make bots and working codes like Petal did. Ignore the code Petal wrote, it's just the code he used to make the Rock Paper Scissors. Click on his link and type in your choice. You can click Run to restart the match
Python is a programming language used to make bots and working codes like Petal did. Ignore the code Petal wrote, it's just the code he used to make the Rock Paper Scissors. Click on his link and type in your choice. You can click Run to restart the match
"Behind this mask there is more than just flesh. Beneath this mask there is an idea... and ideas are bulletproof." -V
jdg
Member
1,404 posts
2,110
Seen 10th August 2023
3rd August 2015, 06:37 PM
Hashir wrote on 3rd August 2015 06:02 PM:
Seems like a lot of you are confused.
Python is a programming language used to make bots and working codes like Petal did. Ignore the code Petal wrote, it's just the code he used to make the Rock Paper Scissors. Click on his link and type in your choice. You can click Run to restart the match
Python is a programming language used to make bots and working codes like Petal did. Ignore the code Petal wrote, it's just the code he used to make the Rock Paper Scissors. Click on his link and type in your choice. You can click Run to restart the match
Taking javascript now with node.js
- "Behind this mask there is more than just flesh. Beneath this mask there is an idea... and ideas are bulletproof." -V
jdg
Member
1,404 posts
2,110
Seen 10th August 2023
4th August 2015, 05:46 AM
Cristal412 wrote on 3rd August 2015 10:20 PM:
Even with the explanation on what Python is, I still don't get the coding...or the whole website thing 0.0
.. Ignore the website, it's just to RUN the script. Python is a programming language, there are different types of languages.
- "Behind this mask there is more than just flesh. Beneath this mask there is an idea... and ideas are bulletproof." -V
Moderator
269 posts
1,383
Seen 31st August 2023
4th August 2015, 08:40 AM
Very nice work.
Although I would recommend one thing, which could prevent confusion for players:
Where you have playerC = raw_input("What is your choice? ")
you should change that to
playerC = raw_input("What is your choice? ").lower()
Why? Well, if a user just so happened to have caps lock on or something like that, if he had any capitals letters in his choice, it'd say it was an invalid choice.
I know it's not very important for a game as simplistic as this, but as I know you're new to Python, it's worth noting for more advanced future projects!
Although I would recommend one thing, which could prevent confusion for players:
Where you have playerC = raw_input("What is your choice? ")
you should change that to
playerC = raw_input("What is your choice? ").lower()
Why? Well, if a user just so happened to have caps lock on or something like that, if he had any capitals letters in his choice, it'd say it was an invalid choice.
I know it's not very important for a game as simplistic as this, but as I know you're new to Python, it's worth noting for more advanced future projects!
Adam
jdg
Member
1,404 posts
2,110
Seen 10th August 2023
4th August 2015, 08:54 AM
Wheeler wrote on 4th August 2015 08:40 AM:
Very nice work.
Although I would recommend one thing, which could prevent confusion for players:
Where you have playerC = raw_input("What is your choice? ")
you should change that to
playerC = raw_input("What is your choice? ").lower()
Why? Well, if a user just so happened to have caps lock on or something like that, if he had any capitals letters in his choice, it'd say it was an invalid choice.
I know it's not very important for a game as simplistic as this, but as I know you're new to Python, it's worth noting for more advanced future projects!
Although I would recommend one thing, which could prevent confusion for players:
Where you have playerC = raw_input("What is your choice? ")
you should change that to
playerC = raw_input("What is your choice? ").lower()
Why? Well, if a user just so happened to have caps lock on or something like that, if he had any capitals letters in his choice, it'd say it was an invalid choice.
I know it's not very important for a game as simplistic as this, but as I know you're new to Python, it's worth noting for more advanced future projects!
- "Behind this mask there is more than just flesh. Beneath this mask there is an idea... and ideas are bulletproof." -V
Member
211 posts
122
Seen 4th September 2015
4th August 2015, 12:48 PM
oh cool, maybe I'll try it!
Hey! I am Lauren12.
Abby1 | Kadencedj | Katnip | Liv8757 | MikeSchmdit | Pancakes15 | cheilsea7 | foxyguy | harry0potter | lovely56 | sparklewater | lily1117 | Milkshake8 | Cowffee | Sadie | Foxehhhh | Starflower | Hashir | Paperback | lulu2 | Cristal412 | sydney123 | Lita | Ohiotoo/BlackandWhite |
If I forgot you please tell me. If you would like to be friends just ask!
jdg
Member
1,404 posts
2,110
Seen 10th August 2023
jdg
Member
1,404 posts
2,110
Seen 10th August 2023
6th August 2015, 06:37 AM
Luke wrote on 6th August 2015 06:03 AM:
Ah Python is a great programming skill to know. I'm currently learning it at school and it's amazing what you can do with the code that you make!
- "Behind this mask there is more than just flesh. Beneath this mask there is an idea... and ideas are bulletproof." -V