Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Spiel:
- def __init__(self):
- self.zug = 1
- self.zzug = 1
- def anfang(self):
- x = input("Hey Player 1, wie heisst du?")
- print("Hi",x)
- x1 = input("Nimmst du Schere, Stein oder Papier?")
- print("Danke",x)
- print("Reiche deinem Gegenspieler das Gerät")
- y = input("Hey Player 2, wie heisst du?")
- print("Hi", y)
- y1 = input("Nimmst du Schere, Stein oder Papier?")
- print("Danke", y)
- print(x1, "Versus", y1)
- def zug1(self):
- if (x1 == "Schere"):
- self.zug = 1
- print(self.zug)
- elif (x1 == "Stein"):
- self.zug = 2
- elif (x1 == "Papier"):
- self.zug = 3
- def zug2(self):
- if (y1 == "Schere"):
- self.zzug = 1
- elif (y1 == "Stein"):
- self.zzug = 2
- elif (y1 == "Papier"):
- self.zzug = 3
- def auswertung(self):
- if (self.zug == 1) and (self.zzug == 1):
- print("Gleichstand")
- elif (self.zug == 1) and (self.zzug == 2):
- print(y, "gewinnt")
- elif (self.zug == 1) and (self.zzug == 3):
- print(x, "gewinnt")
- elif (self.zug == 2) and (self.zzug == 1):
- print(x, "gewinnt")
- elif (self.zug == 2) and (self.zzug == 2):
- print("Gleichstand")
- elif (self.zug == 2) and (self.zzug == 3):
- print(y, "gewinnt")
- elif (self.zug == 3) and (self.zzug == 1):
- print(y, "gewinnt")
- elif (self.zug == 3) and (self.zzug == 2):
- print(x, "gewinnt")
- elif (self.zug == 3) and (self.zzug == 3):
- print("Gleichstand")
- def potato(a,b):
- r=a+b
- return(r)
- o=potato(4,5)
- print(o)
- Spiel = Spiel()
- Spiel.anfang()
- Spiel.zug1()
- Spiel.zug2()
- Spiel.auswertung()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement