from wonderLang import *
def square5(x, y, length):
    i =0
    while i<5:
        square(x, y, length)
        x=x+length
        i=i+1
# square5(0,0,30)不明白哪里错了,求解

8 条评论

  • @ 2023-4-5 19:55:11

    from wonderLang import * def square5(x, y, l): j = 0 i = 0 length = l angle = 90 turtle.goto(x,y) while j < 5: while i < 4: turtle.forward(length) turtle.right(angle) i = i + 1 i = 0 turtle.forward(30) j = j + 1 square5(0,0,30)

    • @ 2022-12-4 11:31:22
      def square(x,y,l):
          jump(x,y)
          angle = 90
          i = 0
          while i < 4:
              forward(l)
              right(angle)
              i = i + 1
      def square5():
          x = 0
          y = 0
          l = 30
          i = 0
          while i < 5:
              square(x,y,l)
              x = x + l
              i = i + 1
      square5()
      
      
      • @ 2022-12-29 18:59:03

        以后尽量说清思路,不然对方只会抄代码的,另外,徐老师说了,尽量要一步一步来,否则到比赛什么的就会露馅

    • @ 2022-11-29 18:31:35
      from wonderLang import *
      
      def square(x,y):
          angle = 90
          i = 0
          while i < 4:
                  forward(x)
                  right(y)
                  i = i + 1
      square(30,90)
      jump(30+0,0)
      square(30,90)
      jump(60+0,0)
      square(30,90)
      jump(90+0,0)
      square(30,90)
      jump(120+0,0)
      square(30,90)
      

      高级机密😄 @陈浩宇666. 加油👍

      • @ 2022-10-24 20:48:42

        你square定义了吗?

        
        
        • @ 2022-10-24 20:45:53
          from wonderLang import *
          def polygon(length, angle, sides):
              i = 0
              while i < sides:
                  forward(length)
                  right(angle)
                  i = i + 1
          polygon(30, 90., 4)
          forward(30)
          polygon(30, 90., 4)
          forward(30)
          polygon(30, 90., 4)
          forward(30)
          polygon(30, 90., 4)
          forward(30)
          polygon(30, 90., 4)
          

          你看一下,我的是100的。

          • @ 2022-12-29 18:58:55

            以后尽量说清思路,不然对方只会抄代码的,另外,徐老师说了,尽量要一步一步来,否则到比赛什么的就会露馅

        • @ 2022-10-23 21:06:44

          我不会

        • @ 2022-10-21 16:09:47

          应该是 Hangup,编译错误,你的 square 函数没有定义

          • @ 2022-10-21 16:09:14

            你看看报错的内容是什么

            • 1