Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_DIY1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ab4a6cc6
authored
Dec 25, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
284a0b44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
diy1.py
diy1.py
View file @
ab4a6cc6
player
=
input
(
"请出拳(石头/剪刀/布)"
)
import
turtle
print
(
"玩家出拳:"
+
player
)
screen
=
turtle
.
Screen
()
import
random
screen
.
bgcolor
(
"light blue"
)
list
=
[
"剪刀"
,
"石头"
,
"布"
]
pen
=
turtle
.
Pen
()
com
=
random
.
choice
(
list
)
pen
.
penup
()
print
(
com
)
pen
.
goto
(
1000
,
-
100
)
if
player
==
com
:
pen
.
write
(
"Hi,诺依~
\n
用python写电子贺卡真是太有趣了~
\n
我也喜欢python~
\n
---悟空"
,
font
=
(
"Times"
,
20
,
"normal"
))
print
(
"平局"
)
pen
.
hideturtle
()
elif
player
==
"剪刀"
and
com
==
"布"
:
pen1
=
turtle
.
Pen
()
print
(
"玩家赢"
)
pen1
.
pencolor
(
"red"
)
elif
player
==
"剪刀"
and
com
==
"石头"
:
pen1
.
pensize
(
5
)
print
(
"玩家输"
)
len
=
screen
.
textinput
(
"提示"
,
"你想要多大的爱心呀?"
)
elif
player
==
"布"
and
com
==
"石头"
:
lov
print
(
"玩家赢"
)
elif
player
==
"布"
and
com
==
"剪刀"
:
print
(
"玩家输"
)
elif
player
==
"石头"
and
com
==
"剪刀"
:
print
(
"玩家赢"
)
elif
player
==
"石头"
and
com
==
"布"
:
print
(
"玩家输"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment