Advertisement
dimkiriakos

petra_psalidi_xarti

Jan 27th, 2022
1,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.19 KB | None | 0 0
  1. import random
  2.  
  3. #print(random.randrange(0,3)) # Ψευδοτυχαίοι
  4. #print(random.randint(0,3)) # Τυχαίοι
  5.  
  6. # Αρχικοποίηση τιμών
  7.  
  8. Petra = 1
  9. Psalidi = 2
  10. Xarti = 3
  11.  
  12. actions = {
  13.     1: '🪨',
  14.     2: '✂️',
  15.     3: '🧻'
  16. }
  17.  
  18.  
  19. print (' Δώστε μια από τις παρακάτω τιμές κι enter ')
  20. print (' 🪨 = ', 1, ' ✂️ = ', 2, ' 🧻 = ', 3)
  21.  
  22. while True:
  23.     Paixtis = int(input())
  24.     Ypologistis = random.randint(1, 3)
  25.    
  26.     print (' Επιλογή του παίχτη ', actions[Paixtis], ' Επιλογή του υπολογιστή ', actions[Ypologistis])
  27.  
  28.     if (Ypologistis == Paixtis):
  29.         print (' Ισοπαλία ')
  30.     #------------------------------------------------
  31.    
  32.     if (Ypologistis == Petra and Paixtis == Psalidi):
  33.         print (f' Νίκησε ο υπολογιστής ')
  34.      
  35.  
  36.     if (Ypologistis == Petra and Paixtis == Xarti):
  37.         print (' Νίκησε ο παίχτης ')
  38.    
  39.  
  40.     #------------------------------------------------
  41.  
  42.     if (Ypologistis == Psalidi and Paixtis == Petra):
  43.         print (' Νίκησε ο παίχτης ')
  44.    
  45.  
  46.     if (Ypologistis == Psalidi and Paixtis == Xarti):
  47.         print (' Νίκησε ο υπολογιστής ')
  48.    
  49.  
  50.     #------------------------------------------------
  51.  
  52.     if (Ypologistis == Xarti and Paixtis == Psalidi):
  53.         print (' Νίκησε ο παίχτης ')
  54.      
  55.  
  56.     if (Ypologistis == Xarti and Paixtis == Petra):
  57.         print (' Νίκησε ο υπολογιστής ')
  58.  
  59.  
  60.     if (Paixtis == 0):
  61.         import os
  62.         os.system('cls') # Καθαρισμός Οθόνης
  63.         print (' Δώστε μια από τις παρακάτω τιμές κι enter ')
  64.         print (' 🪨 = ', Petra, ' ✂️ = ', Psalidi, ' 🧻 = ', Xarti)
  65.  
  66.     if (Paixtis < 0) or (Paixtis > 3):
  67.         import os
  68.         os.system('cls') # Καθαρισμός Οθόνης
  69.         print (' Δώστε μια από τις παρακάτω τιμές κι enter ')
  70.         print (' 🪨 = ', Petra, ' ✂️ = ', Psalidi, ' 🧻 = ', Xarti)
  71.         # ' 🪨 = ', 1, ' ✂️ = ', 1, ' 🧻 = ', 3
  72.  
  73. Stand_By = input()
  74.  
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement