Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_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
fed6071f
authored
Apr 13, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
816996be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
diy1.py
diy1.py
View file @
fed6071f
player
=
input
(
"玩家出拳 石头/剪刀/布"
)
import
turtle
print
(
"玩家出拳"
+
player
)
pen
=
turtle
.
Pen
()
import
random
as
r
list
=
(
"石头"
,
"剪刀"
,
"布"
)
com
=
r
.
choice
(
list
)
pen
.
pensize
(
5
)
print
(
"电脑出拳"
+
com
)
pen
.
pencolor
(
"pink"
)
if
com
==
player
:
pen
.
left
(
45
)
print
(
"平局"
)
pen
.
forward
(
100
)
elif
com
==
"石头"
and
player
==
"布"
or
com
==
"布"
and
player
==
"剪刀"
or
com
==
"剪刀"
and
player
==
"石头"
:
pen
.
circle
(
50
,
180
)
print
(
"你赢了"
)
pen
.
right
(
90
)
elif
com
==
"布"
and
player
==
"石头"
or
com
==
"剪刀"
and
player
==
"布"
or
com
==
"石头"
and
player
==
"剪刀"
:
pen
.
circle
(
50
,
180
)
print
(
"你输了"
)
pen
.
forward
(
100
)
\ No newline at end of file
pen
.
penup
()
pen
.
goto
(
100
,
0
)
pen
.
write
(
"hi,nuo yi, 我想为你吟一首四季诗"
,
font
=
(
"Times"
,
30
,
"normal"
))
pen
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
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