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
345379f7
authored
Mar 13, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
bd3369f6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
24 deletions
diy.py
diy1.py
diy2.py
diy3.py
f.py
diy.py
0 → 100644
View file @
345379f7
import
turtle
a
=
turtle
.
Pen
()
a
.
pensize
(
10
)
a
.
penup
()
a
.
goto
(
0
,
-
50
)
a
.
pendown
()
a
.
color
(
"red"
)
a
.
circle
(
100
)
a
.
left
(
90
)
a
.
forward
(
200
)
a
.
right
(
180
)
a
.
forward
(
100
)
a
.
left
(
90
)
a
.
forward
(
100
)
a
.
left
(
180
)
a
.
forward
(
200
)
turtle
.
done
()
\ No newline at end of file
diy1.py
View file @
345379f7
# 玩家出拳
import
turtle
import
random
a
=
turtle
.
Pen
()
a
=
input
(
"你出什么(石头/剪刀/布)!"
)
a
.
pensize
(
10
)
print
(
"玩家出拳:"
+
a
)
a
.
penup
()
list
=
[
"石头"
,
"剪刀"
,
"布"
]
a
.
goto
(
-
100
,
0
)
b
=
random
.
choice
(
list
)
a
.
pendown
()
print
(
b
)
a
.
color
(
"blue"
)
if
a
in
list
:
a
.
circle
(
50
)
if
b
==
a
:
a
.
penup
()
print
(
"平局"
)
a
.
goto
(
20
,
0
)
elif
b
==
"石头"
and
a
==
"剪刀"
:
a
.
pendown
()
print
(
"你已经死了"
)
a
.
color
(
"black"
)
elif
b
==
"布"
and
a
==
"石头"
:
a
.
circle
(
50
)
print
(
"你已经死了"
)
a
.
penup
()
elif
b
==
"剪刀"
and
a
==
"布"
:
a
.
goto
(
140
,
0
)
print
(
"你已经死了"
)
a
.
pendown
()
elif
b
==
"剪刀"
and
a
==
"石头"
:
a
.
color
(
"red"
)
print
(
"you win"
)
a
.
circle
(
50
)
elif
b
==
"布"
and
a
==
"剪刀"
:
a
.
penup
()
print
(
"you win"
)
a
.
goto
(
-
40
,
-
70
)
elif
b
==
"石头"
and
a
==
"布"
:
a
.
pendown
()
print
(
"you win"
)
a
.
color
(
"yellow"
)
else
:
a
.
circle
(
50
)
print
(
"输入错误"
)
a
.
penup
()
a
.
goto
(
80
,
-
70
)
a
.
pendown
()
a
.
color
(
"green"
)
a
.
circle
(
50
)
turtle
.
done
()
\ No newline at end of file
diy2.py
0 → 100644
View file @
345379f7
import
turtle
a
=
turtle
.
Pen
()
a
.
penup
()
a
.
goto
(
0
,
-
50
)
a
.
pendown
()
a
.
fillcolor
(
"red"
)
a
.
begin_fill
()
a
.
circle
(
50
)
a
.
end_fill
()
a
.
penup
()
a
.
goto
(
-
150
,
100
)
a
.
pendown
()
a
.
forward
(
300
)
a
.
right
(
90
)
a
.
forward
(
200
)
a
.
right
(
90
)
a
.
forward
(
300
)
a
.
right
(
90
)
a
.
forward
(
200
)
turtle
.
done
()
\ No newline at end of file
diy3.py
0 → 100644
View file @
345379f7
SB
=
input
(
"大智者数字是撒: "
)
print
(
"百: "
+
SB
[
0
]
+
"十: "
+
SB
[
1
]
+
"个: "
+
SB
[
2
])
\ No newline at end of file
f.py
0 → 100644
View file @
345379f7
import
random
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