Tudjewuj

KeyDevS | Video #4

Mar 31st, 2023
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.11 KB | None | 0 0
  1. from time import sleep
  2. from colorama import init, Fore, Style
  3. import os
  4. import random
  5. print(f'''{Fore.LIGHTRED_EX}{Style.BRIGHT}
  6. ██████╗░██╗░░░██╗  ██╗░░██╗███████╗██╗░░░██╗██████╗░███████╗██╗░░░██╗░██████╗
  7. ██╔══██╗╚██╗░██╔╝  ██║░██╔╝██╔════╝╚██╗░██╔╝██╔══██╗██╔════╝██║░░░██║██╔════╝
  8. ██████╦╝░╚████╔╝░  █████═╝░█████╗░░░╚████╔╝░██║░░██║█████╗░░╚██╗░██╔╝╚█████╗░
  9. ██╔══██╗░░╚██╔╝░░  ██╔═██╗░██╔══╝░░░░╚██╔╝░░██║░░██║██╔══╝░░░╚████╔╝░░╚═══██╗
  10. ██████╦╝░░░██║░░░  ██║░╚██╗███████╗░░░██║░░░██████╔╝███████╗░░╚██╔╝░░██████╔╝
  11. ╚═════╝░░░░╚═╝░░░  ╚═╝░░╚═╝╚══════╝░░░╚═╝░░░╚═════╝░╚══════╝░░░╚═╝░░░╚═════╝░''')
  12. print(Style.RESET_ALL)
  13. sleep(3.5)
  14. os.system('cls')
  15. while True:
  16.     bot_choice = random.choice(['Камень', 'Ножницы', 'Бумага'])
  17.     print(Fore.YELLOW)
  18.     player_choice = str(input("Введите ход: ").lower())
  19.     print(Style.RESET_ALL)
  20.     if bot_choice == 'Камень' and player_choice == 'камень':
  21.         print(f'{Fore.RED}Ничья!')
  22.         print(Style.RESET_ALL)
  23.     elif bot_choice == 'Камень' and player_choice == 'ножницы':
  24.         print(f'{Fore.RED}Вы проиграли!')
  25.         print(Style.RESET_ALL)
  26.     elif bot_choice == 'Камень' and player_choice == 'бумага':
  27.         print(f'{Fore.GREEN}Вы выйграли!')
  28.         sleep(10)
  29.         break
  30.     elif bot_choice == 'Ножницы' and player_choice == 'камень':
  31.         print(f'{Fore.GREEN}Вы выйграли!')
  32.         sleep(10)
  33.         break
  34.     elif bot_choice == 'Ножницы' and player_choice == 'ножницы':
  35.         print(f'{Fore.RED}Ничья!')
  36.         print(Style.RESET_ALL)
  37.     elif bot_choice == 'Ножницы' and player_choice == 'бумага':
  38.         print(f'{Fore.RED}Вы проиграли!')
  39.         print(Style.RESET_ALL)
  40.     elif bot_choice == 'Бумага' and player_choice == 'камень':
  41.         print(f'{Fore.RED}Вы проиграли!')
  42.         print(Style.RESET_ALL)
  43.     elif bot_choice == 'Бумага' and player_choice == 'ножницы':
  44.         print(f'{Fore.GREEN}Вы выйграли!')
  45.         sleep(10)
  46.         break
  47.     elif bot_choice == 'Бумага' and player_choice == 'бумага':
  48.         print(f'{Fore.RED}Ничья!')
  49.         print(Style.RESET_ALL)
  50.     else:
  51.         print(f'{Fore.RED}Вы ввели неправильный ход!')
  52.         print(Style.RESET_ALL)
Advertisement
Add Comment
Please, Sign In to add comment