def center_rect(x, y, w, h, n): x = 0 y = 0 i = 0 while i < n: jump(x, y) i = i + 1

def switzerland(x, y) : w = 200 h = 200 center_rect(x, y, w, h) center_rect(x, y, 75, 25) center_rect(x, y, 25, 75)

switzerland(0,0)


7 条评论

  • @ 2023-8-2 10:23:48
    from wonderLang import *
    
    def rect (w,h):
        i=0
        while i<2:
            forward(w)
            right(90)
            forward(h)
            right(90)
            i=i+1
    def center_rect(x, y, w, h):
        jump(x,y)
        jump(x-w/2,y+h/2)
        rect(w,h)
    center_rect(0,0,200,200)
    center_rect(0,0,75,25)
    center_rect(0,0,25,75)
    
    
    • @ 2023-7-25 20:00:36
      from wonderLang import *
      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 switzerland(x, y) :
          w = 200
          h = 200
          center_rect(x, y, w, h)
          center_rect(x, y, 75, 25,)
          center_rect(x, y, 25, 75,)
      
      switzerland(0,0)
      
      • @ 2023-7-4 21:25:03

        能不能搞清楚@刘思祺

        • @ 2023-6-30 20:43:57

          from wonderLang import * import math

          def rect(x,y,w,h): jump(x,y) angle = 90 i = 0 angle = 90 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 switzerland(x, y): jump(x,y) center_rect(x,y,200,200) center_rect(x,y,75,25) center_rect(x, y, 25, 75) switzerland(0,0)

          • @ 2023-6-6 22:19:04

            `给大家整理出来了,调一下就行了`` import turtle import math def circle(x,y,r): x1=x y1=y-r turtle.goto(x1, y1) turtle.circle(r)

            def sin(degree): radians = degree * math.pi / 180 return math.sin(radians)

            def cos(degree): radians = degree * math.pi / 180 return math.cos(radians) def star(length,angle): i = 0 while i < 1: turtle.color('white') turtle.begin_fill() turtle.forward(length) turtle.right(angle) turtle.forward(length) turtle.right(angle) turtle.forward(length) turtle.right(angle) turtle.forward(length) turtle.right(angle) turtle.forward(length) turtle.right(angle) turtle.end_fill() i = i + 1

            turtle.color('red')

            turtle.begin_fill()

            circle(0,0,400/2)

            turtle.end_fill()

            turtle.color('white')

            turtle.begin_fill()

            circle(0,0,340/2)

            turtle.end_fill()

            turtle.color('red')

            turtle.begin_fill()

            circle(0,0,280/2)

            turtle.end_fill()

            turtle.color('blue')

            turtle.begin_fill()

            circle(0,0,240/2)

            turtle.end_fill()

            turtle.color('white')

            turtle.color('white')

            turtle.begin_fill()

            turtle.color('white')

            turtle.goto(-110,35) star(225,144)

            turtle.end_fill()

            
            
            • @ 2023-5-17 21:15:06

              又SSD

            • @ 2023-5-17 12:28:56

              center_rect没定义!!!

              • 1

              信息

              ID
              59
              时间
              1000ms
              内存
              256MiB
              难度
              3
              标签
              递交数
              1049
              已通过
              527
              上传者