22 lines
672 B
Python
22 lines
672 B
Python
import getpass
|
|
|
|
punkte1 = 0
|
|
punkte2 = 0
|
|
while punkte1 or punkte2 < 3:
|
|
|
|
print ("S = Schere, R = Stein, P = Papier ")
|
|
s1 = getpass.getpass( "Spieler 1 Wähle: ")
|
|
s2 = getpass.getpass( "Spieler 2 Wähle: ")
|
|
|
|
if s1 == "s" and s2 == "p" or s1 == "p" and s2 == "r" or s1 == "r" and s2 == "s":
|
|
print("Spieler 1 hat gewonnen")
|
|
punkte1 += 1
|
|
print("Spieler 1 hat :", punkte1, "Punkte")
|
|
if punkte1 == 3:
|
|
break
|
|
else:
|
|
print("Spieler 2 hat gewonnen")
|
|
punkte2 += 1
|
|
print("Spieler 2 hat:", punkte2, "Punkte")
|
|
if punkte2 == 3:
|
|
break |