- 朝鲜国旗
我这题错在哪
- 2023-3-23 20:32:16 @
from wonderLang import * import math
def polygon(sides, length):
angle=(180 - ((sides - 2) * 180 / sides))
i=0
while i < sides:
forward(length)
right(angle)
i = i + 1
def circle(x, y, r): sides = 36 jump(x,y) length= 2 * math.pi * r left_angle = (90 + (360 / sides) / 2) right(-left_angle) forward(r) right(left_angle) polygon(sides,length)
def rect(x,y,w,h): jump(x,y) angle=90 i=0 while i<2: forward(w) right(angle) forward(h) right(angle) i=i+1 def center_rect(x, y, w, h): jump(x,y) x1=x-w/2 y1=y+h/2 rect(x1,y1,w,h)
def sin(degree): import math
radians = degree * math.pi / 180 return math.sin(radians)
def cos(degree):
import math
radians = degree * math.pi / 180
return math.cos(radians)
def star(x,y,lenght): jump(x,y) angle = 144 i = 0 while i < 5: forward(lenght) right(angle) i = i + 1 def center_star(x,y,r): angle=18 x1=x - cos(angle) * r y1= y + sin(angle) * r length = cos(angle) * r * 2 star(x1,y1,length)
def switzerland(x, y): jump(x,y) w=200 h=200 center_rect(x,y,w,h) center_rect(x,y,75,25) center_rect(x,y,25,75)
7 条评论
-
谢力阳 LV 5 @ 2023-8-4 10:56:59
from wonderLang import * def northkorea(x,y): def centre_rect(x, y, w, h): i = 0 jump(x - w / 2, y + h / 2) while i < 2: forward(w) right(90) forward(h) right(90) i = i + 1 def centre_star(x, y, r): star_jump(x, y, r) length = star_length(r) def star(): i = 0 while i < 5: forward(length) right(144) i = i + 1 star() def circle(x, y, r): i = 0 jump(x, y + r) while i < 100: forward(2 * 3.1415926 * r / 100) right(360 / 100) i = i + 1 centre_rect(x,y,300,200) centre_rect(x,y,300,200/25*17) centre_rect(x,y,300,200/25*15) jump(x-55,y) circle(x-55,y,200/25*5) jump(-55,y) centre_star(x-55,y,200/25*5) northkorea(0,0)
-
2023-7-4 21:32:53@
我会
from wonderLang import * import math def star(x,y,length): jump(x,y) angle = 144 i = 0 while i < 5: forward(length) right(angle) i = i + 1 def cender_star(x,y,r): jump(x,y) angle = 18 x1 = x - cos(angle) * r y1 = y + sin(angle) * r length = cos(angle) * r * 2 star(x1,y1,length) def polygon2(sides,length): angle = 180 - ((sides - 2) * 180 / sides) i = 0 while i < sides: forward(length) right(angle) i = i + 1 def circle(x,y,r): jump(x,y) sides = 36 length = (2 * math.pi * r) / sides left_angle = (90 + (360 / sides) / 2) right(-left_angle) forward(r) right(left_angle) polygon2(sides,length) def rect(x,y,w,h): jump(x,y) angle = 90 i = 0 while i < 2: forward(w) right(angle) forward(h) right(angle) i = i + 1 def center_rect(x, y, w, h): jump(x, y) x1 = x - w / 2 y1 = y + h / 2 rect(x1,y1,w, h) def sin(degree): import math radians = degree * math.pi / 180 return math.sin(radians) def cos(degree): import math radians = degree * math.pi / 180 return math.cos(radians) def center_star(x, y, r): jump(x, y) angle = 18 x1 = x - cos(angle) * r y1 = y + sin(angle) * r length = cos(angle) * r * 2 star(x1,y1,length) def northkorea(x,y): w = 300 h = 200 center_rect(x,y,w,h) w1 = 300 h1 = h * (1 + 15 + 1) / (4 + 1 + 15 + 1 + 4) center_rect(x,y,w1,h1) w2 = 300 h2 = h * 15 / (4 + 1 + 15 + 1 + 4) center_rect(x,y,w2,h2) r = h2 * 2 / 3 / 2 circle(x - w / 2 / 5 * 2,y,r) cender_star(x - w / 2 / 5 * 2,y,r) northkorea(0,100)
这是全部
-
2023-3-25 19:26:36@
不好意思,发错了
-
2023-3-25 17:30:17@
好简单啊,我会了:
def northkorea(x, y): w = 300 h = 200 center_rect(x,y,w,h) w1 = 300 h1 = h * (1+15+1)/(4+1+15+1+4) center_rect(x,y,w1,h1) w2 = 300 h2 = h * 15 / (4 + 1 + 15 + 1 + 4) center_rect(x, y, w2, h2) r = h2 * 2 / 3 / 2 circle(x - w / 2 / 5,y ,r) center_star(x - w / 2 / 5,y ,r) northkorea(0,100)
-
2023-3-24 17:57:51@
老师有课程,你可以看看
-
2023-3-24 7:30:16@
不然我们看不到你有没有缩进问题
-
2023-3-24 7:29:08@
请您把代码全部用代码块表现出来
- 1
信息
- ID
- 60
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- 递交数
- 1673
- 已通过
- 517
- 上传者