Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import random
- list = ['Камень', 'Ножницы', 'Бумага']
- scoreboard = {}
- print("Введите ваше имя:")
- scoreboard['name'] = input()
- scoreboard['score'] = 0
- print('''Чтобы играть выберете один из вариантов: Камень, Ножницы или Бумага и нажмите ENTER''')
- print('Если хотите закончить игру')
- print('Введите "Конец игры"')
- print('')
- while True:
- a = str(input())
- b = random.choice(list)
- # print("debug")
- if a.lower == 'конец игры':
- #print('Пока')
- break
- elif (a.title == 'Камень' and b.title == 'Камень') or (a.title == 'Ножницы' and b.title == 'Ножницы') or (a.title == 'Бумага' and b.title == 'Бумага'):
- print(b)
- print('')
- print('Ничья!')
- print('')
- elif (a.title == 'Камень' and b.title == 'Бумага') or (a.title == 'Бумага' and b.title == 'Ножницы') or (a.title == 'Ножницы' and b.title == 'Камень'):
- print(b)
- scoreboard['score'] = scoreboard['score'] - 1
- print('\nКомпьютер победил! Попробуй еще раз\n')
- elif (a.title == 'Камень' and b.title == 'Ножницы') or (a.title == 'Ножницы' and b.title == 'Бумага') or (a.title == 'Бумага' and b.title == 'Камень'):
- print(b)
- scoreboard['score'] = scoreboard['score'] + 1
- print('\nТы победил! Но получится ли в следующий раз?\n')
- else:
- print('Я тебя не понял')
- print("Поздравляю " + scoreboard['name'] + ", вами набрано " + str(scoreboard['score']) + " очков.")
Advertisement
Add Comment
Please, Sign In to add comment