HOME FORUMS MEMBERS RECENT POSTS LOG IN  
× Авторизация
Имя пользователя:
Пароль:
Нет аккаунта? Регистрация
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ ЧАТ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > Python
   
 
 
Опции темы Поиск в этой теме Опции просмотра

  #1  
Старый 16.12.2023, 09:03
Vаnish
Новичок
Регистрация: 11.07.2022
Сообщений: 28
С нами: 2024306

Репутация: 8
По умолчанию

Python:





Код:
import
random
import
ASCII_paint
import
binascii
def
KMN
(
)
:
variants
=
[
'камень'
,
'ножницы'
,
'бумага'
]
ASCII_paint
.
start
(
)
while
True
:
dec
=
'\nВыберите один из вариантов: камень, ножницы или бумага. Для выхода введите (выход)'
qwe
=
binascii
.
unhexlify
(
dec
)
.
decode
(
"utf-8"
)
print
(
qwe
)
custom_selection
=
input
(
)
.
lower
(
)
hex_representation
=
binascii
.
hexlify
(
custom_selection
.
encode
(
"utf-8"
)
)
.
decode
(
"utf-8"
)
custom_selection
=
hex_representation
if
custom_selection
==
'выход'
:
break
if
custom_selection
not
in
variants
:
dec
=
'Пожалуйста, выберите один из вариантов: камень, ножницы или бумага.'
qwe
=
binascii
.
unhexlify
(
dec
)
.
decode
(
"utf-8"
)
print
(
qwe
)
continue
computer_selection
=
random
.
choice
(
variants
)
if
custom_selection
==
computer_selection
:
if
custom_selection
==
'камень'
:
ASCII_paint
.
stone_stone
(
)
elif
custom_selection
==
'ножницы'
:
ASCII_paint
.
scissors_scissors
(
)
elif
custom_selection
==
'бумага'
:
ASCII_paint
.
paper_paper
(
)
ASCII_paint
.
tie
(
)
elif
(
custom_selection
==
'камень'
and
computer_selection
==
'ножницы'
)
or
\
(
custom_selection
==
'ножницы'
and
computer_selection
==
'бумага'
)
or
\
(
custom_selection
==
'бумага'
and
computer_selection
==
'камень'
)
:
if
custom_selection
==
'камень'
:
ASCII_paint
.
stone_scissors
(
)
elif
custom_selection
==
'ножницы'
:
ASCII_paint
.
scissors_paper
(
)
elif
custom_selection
==
'бумага'
:
ASCII_paint
.
paper_stone
(
)
ASCII_paint
.
win
(
)
elif
(
custom_selection
==
'камень'
and
computer_selection
==
'бумага'
)
or
\
(
custom_selection
==
'ножницы'
and
computer_selection
==
'камень'
)
or
\
(
custom_selection
==
'бумага'
and
computer_selection
==
'ножницы'
)
:
if
custom_selection
==
'камень'
:
ASCII_paint
.
stone_paper
(
)
elif
custom_selection
==
'ножницы'
:
ASCII_paint
.
scissors_stone
(
)
elif
custom_selection
==
'бумага'
:
ASCII_paint
.
paper_scissors
(
)
ASCII_paint
.
lost
(
)
if
__name__
==
"__main__"
:
KMN
(
)
 
Ответить с цитированием
 





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.