-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarta-sasso-forbici-game(+punteggi).py
65 lines (60 loc) · 2.1 KB
/
carta-sasso-forbici-game(+punteggi).py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from getpass import getpass as input
print("E P I C 🪨 📄 ✂️ B A T T L E ")
print()
print("""Benvenuti al gioco SASSO-CARTA-FORBICI!
Ecco cosa fare: a turno, scrivete:
S per SASSO
C per CARTA
F per FORBICI
e scoprite chi ha vinto! Vince la partita chi totalizza per primo 3 punti.
PS: non crediamo che F per FUOCO sia parte di questo gioco. Non ci piacciono queste trovate moderne!""")
print()
punteggio_1 = 0
punteggio_2 = 0
while (punteggio_1 < 3) and (punteggio_2 < 3):
player_1 = input("Giocatore 1, cosa scegli? > ")
player_2 = input("Giocatore 2, cosa scegli? > ")
if (player_1 == "S") and (player_2 == "S"):
print("Avete scelto entrambi SASSO! Parità!")
print()
elif (player_1 == "C") and (player_2 == "C"):
print("Avete scelto entrambi CARTA! Parità!")
print()
elif (player_1 == "F") and (player_2 == "F"):
print("Avete scelto entrambi FORBICI! Parità!")
print()
elif (player_1 == "S"):
if player_2 == "C":
print("Giocatore 2, hai vinto questo round! CARTA batte SASSO!")
punteggio_2 +=1
print()
elif player_2 == "F":
print("Giocatore 1, hai vinto questo round! SASSO batte FORBICI!")
punteggio_1 +=1
print()
elif (player_1 == "C"):
if player_2 == "S":
print("Giocatore 1, hai vinto questo round! CARTA batte SASSO!")
punteggio_1 +=1
print()
elif player_2 == "F":
print("Giocatore 2, hai vinto questo round! FORBICI batte CARTA!")
punteggio_2 +=1
print()
elif (player_1 == "F"):
if player_2 == "C":
print("Giocatore 1, hai vinto questo round! FORBICI batte CARTA!")
punteggio_1 +=1
print()
elif player_2 == "S":
print("Giocatore 2, hai vinto questo round! SASSO batte FORBICI!")
punteggio_2 +=1
print()
else:
print("Errore nella selezione. Ricorda che puoi rispondere solo S, C o F: hai usato le maiuscole? Riprova!")
continue
print("Abbiamo un vincitore!")
if punteggio_1==3:
print("Giocatore 1, hai vinto la partita!")
else:
print("Giocatore 2, hai vinto la partita!")