File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Retos/Reto #6 - PIEDRA, PAPEL, TIJERA, LAGARTO, SPOCK [Media]/python Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ import random as rm
2+
3+ def game_rock_papper_cut ():
4+ while True :
5+ try :
6+ def condicional_game (a ,b ):
7+ if a == 1 and b == 2 :
8+ print ("Pc: 📄\n Tu: 🪨" )
9+ print ("Perdiste" )
10+ elif a == 2 and b == 3 :
11+ print ("Pc: ✂️\n Tu: 📄" )
12+ print ("Perdiste" )
13+ elif a == 3 and b == 1 :
14+ print ("Pc: 🪨\n Tu: ✂️" )
15+ print ("Perdiste" )
16+ elif a == 1 and b == 3 :
17+ print ("Pc: 🪨\n Tu: 📄" )
18+ print ("Ganaste" )
19+ elif a == 2 and b == 1 :
20+ print ("Pc: 📄\n Tu: 🪨" )
21+ print ("Ganaste" )
22+ elif a == 3 and b == 2 :
23+ print ("Pc: ✂️\n Tu: 📄" )
24+ print ("Ganaste" )
25+ elif a == b :
26+ print ("Empate" )
27+ def input_game ():
28+ Player = int (input ("1: Piedra\n 2: Papel\n 3: Tijera\n <<|>> " ))
29+ Pc = rm .randint (1 ,3 )
30+ condicional_game (Player ,Pc )
31+ input_game ()
32+
33+ except TypeError as TyErxx :
34+ print (TyErxx )
35+ print ("😡Solamente Numeros😡" )
36+ input_game ()
37+ except NameError as NamErxx :
38+ print (NamErxx )
39+ except ValueError as ValErxx :
40+ print (ValErxx )
41+ game_rock_papper_cut ()
You can’t perform that action at this time.
0 commit comments