ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Python (https://forum.antichat.xyz/forumdisplay.php?f=205)
-   -   Игра или не игру х## знает (https://forum.antichat.xyz/showthread.php?t=1497656)

Vаnish 16.12.2023 09:03

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
(
)


TravkaCode.lover() 16.12.2023 14:57

ладно?

GrezeeBal 17.12.2023 01:50

мощно


Время: 12:10