Discuss Scratch

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.
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

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!
04tmoody
Scratcher
100+ posts

I need help on my python project

Yeah, I don't think python supports cloud data, though you could maybe save it to a file on your computer, and somehow do it that way.

Hi. I make games. Have a nice day, you're awesome!
red_king_cyclops
Scratcher
500+ posts

I need help on my python project

First, use the [code] tags:
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.

Powered by DjangoBB