Advertisement
MRtecno98

Sasso Carta Forbice remastered for Python

Dec 30th, 2016
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.87 KB | None | 0 0
  1. import random
  2. print("=========================================")
  3. print("Sasso Carta Forbice remastered for Python")
  4. print("      by NEGCommand & MRtecno98")
  5. print("=========================================")
  6. input("            Enter to start")
  7.  
  8. print("\n\n\nInserire il numero di match(-1 per infinito)")
  9. bo = 1
  10. while bo == 1:
  11.     try :
  12.         ms = int(input(">>> "))
  13.     except ValueError:
  14.         print("Inserisci un numero, non una lettera")
  15.     else:
  16.         bo = 0
  17.  
  18. while ms != 0:
  19.     oggutente = input('\nInserisci un oggetto [Sasso|Carta|Forbice|Esci]: ')
  20.     oggcomp = random.randint(1, 3)
  21.    
  22.     if "e" in oggutente or oggutente == "Esci" :
  23.         break
  24.    
  25.     if oggutente == 'Sasso' or "s" in oggutente or "S" in oggutente or oggutente == "sasso":
  26.         if oggcomp == 1:
  27.             print('[Tu:Sasso ','Pc:'+'Sasso]','  PAREGGIO')
  28.         elif oggcomp == 2:
  29.             print('[Tu:Sasso ','Pc:'+'Carta]','  HAI PERSO')
  30.         elif oggcomp == 3:
  31.             print('[Tu:Sasso ','Pc:'+'Forbice]','  HAI VINTO')
  32.         ms = ms - 1
  33.     elif oggutente == 'Carta' or "c" in oggutente or "C" in oggutente or oggutente == "carta":
  34.         if oggcomp == 1:
  35.             print('[Tu:Carta ','Pc:'+'Sasso]','  HAI VINTO')
  36.         elif oggcomp == 2:
  37.             print('[Tu:Carta ','Pc:'+'Carta]','  PAREGGIO')
  38.         elif oggcomp == 3:
  39.             print('[Tu:Carta ','Pc:'+'Forbice]','  HAI PERSO')
  40.         ms = ms - 1
  41.     elif oggutente == 'Forbice' or "f" in oggutente or "F" in oggutente or oggutente == "forbice":
  42.         if oggcomp == 1:
  43.             print('[Tu:Forbice ','Pc:'+'Sasso]','  HAI PERSO')
  44.         elif oggcomp == 2:
  45.             print('[Tu:Forbice ','Pc:'+'Carta]','  HAI VINTO')
  46.         elif oggcomp == 3:
  47.             print('[Tu:Forbice ','Pc:'+'Forbice]','  PAREGGIO')
  48.         ms = ms - 1
  49.     else:
  50.         print("Iserire un oggetto valido")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement