Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » I need help on my python project
- Laksh9
- Scratcher
23 posts
I need help on my python project
Here is my code:
from random import *
player1=False
player2 = False
while player1==False and player2 == False:
player1=input(“Rock paper or scissors for p1? (Don't use caps!)”)
player1=input(“Rock paper or scissors for p2? (Don't use caps!)”)
if player1==player2:
print(“tie”)
elif player1==“rock”:
if player2==“paper”:
print(“p1 loses.”)
else:
print(“p1 wins!”)
elif player1==“paper”:
if player2==“scissors”:
print (“player2 win!”)
else:
print(“player1 win”)
elif player1==“scissors”:
if player2==“rock”:
print (“player2 win!”)
else:
print(“player1 win”)
else:
print(“Incorrect spelling,use real grammer”)
player1=False
i need helps in making it a cloud multiplayer game. i thought that some people on scratch are very knowlageable in python so they could help me do my project. please help me. any suggestions will be appriciated.
from random import *
player1=False
player2 = False
while player1==False and player2 == False:
player1=input(“Rock paper or scissors for p1? (Don't use caps!)”)
player1=input(“Rock paper or scissors for p2? (Don't use caps!)”)
if player1==player2:
print(“tie”)
elif player1==“rock”:
if player2==“paper”:
print(“p1 loses.”)
else:
print(“p1 wins!”)
elif player1==“paper”:
if player2==“scissors”:
print (“player2 win!”)
else:
print(“player1 win”)
elif player1==“scissors”:
if player2==“rock”:
print (“player2 win!”)
else:
print(“player1 win”)
else:
print(“Incorrect spelling,use real grammer”)
player1=False
i need helps in making it a cloud multiplayer game. i thought that some people on scratch are very knowlageable in python so they could help me do my project. please help me. any suggestions will be appriciated.
- DaEpikDude
- Scratcher
1000+ posts
I need help on my python project
1. i don't think python supports online stuff
2. it might be a better idea to put the outcomes in a dictionary instead of having a million cascading if statements
3. use the [code] tag in future, it looks better
2. it might be a better idea to put the outcomes in a dictionary instead of having a million cascading if statements
3. use the [code] tag in future, it looks better
And all the world over, each nation's the same,
They've simply no notion of playing the game.
They argue with umpires, they cheer when they've won,
And they practice beforehand, which ruins the fun!
- red_king_cyclops
- Scratcher
500+ posts
I need help on my python project
First, use the [code] tags:
Second, cloud variables are only a thing on Scratch. For making multiplayer games in other languages, I think you have to use public databases but I am not certain.
from random import * player1=False player2 = False while player1==False and player2 == False: player1=input(“Rock paper or scissors for p1? (Don't use caps!)”) player1=input(“Rock paper or scissors for p2? (Don't use caps!)”) if player1==player2: print(“tie”) elif player1==“rock”: if player2==“paper”: print(“p1 loses.”) else: print(“p1 wins!”) elif player1==“paper”: if player2==“scissors”: print (“player2 win!”) else: print(“player1 win”) elif player1==“scissors”: if player2==“rock”: print (“player2 win!”) else: print(“player1 win”) else: print(“Incorrect spelling,use real grammer”) player1=False
Second, cloud variables are only a thing on Scratch. For making multiplayer games in other languages, I think you have to use public databases but I am not certain.
2+2=4
2*2=4
2^2=4
2^^2=4
2^^^2=4
2^^^^2=4
…
I see a pattern.
- Discussion Forums
- » Things I'm Making and Creating
- » I need help on my python project