gfl411050509

import turtle as t
import time
def popspace():
    t.penup()
    t.fd(5)
def popline(draw):
popspace()
   t.pendown() if draw else t.penup()
   t.fd(40)
   popspace()
   t.right(90)
def popstart(d):
     popline(True) if d in [2,3,4,5,6,8,9] else popline(False)
     popline(True) if d in [0,1,3,4,5,6,7,8,9] else popline(False)
    popline(True) if d in [0,2,3,5,6,8,9] else popline(False)
    popline(True) if d in [0,2,6,8] else popline(False)
    t.left(90)
    popline(True) if d in [0,4,5,6,8,9] else popline(False)
    popline(True) if d in [0,2,3,5,6,7,8,9] else popline(False)
    popline(True) if d in [0,1,2,3,4,7,8,9] else popline(False)
    t.left(180)
    t.penup()
   t.fd(30)
def popdate(date):
   t.pencolor((1,0.36,0.28))
   t.speed(9)
for i in date:
    if i == \'-\':
        t.write(\'年\',font=("Arial", 30, "normal"))
        t.pencolor((0.93,0.51,0.93))
        t.fd(60)
   elif i == \'=\':
        t.write(\'月\',font=("Arial", 30, "normal"))
        t.pencolor((0.5,0.5,0))
        t.fd(60)
   elif i == \'+\':
       t.write(\'日\',font=("Arial", 30, "normal"))
       t.pencolor((0.25,0.88,0.82))
       t.fd(40)
      #换行输出
      t.seth(-90)
      t.fd(100)
      t.seth(180)
      t.fd(700)
      t.seth(-90)
      t.fd(40)
      t.seth(0)
      t.fd(40)
  elif i == \'*\':
     t.write(\'时\',font=("Arial", 30, "normal"))
     t.pencolor((0.18,0.55,0.34))
     t.fd(60)
 else:
     popstart(eval(i))
def main():
     t.setup(1000, 800, None,None)
     t.penup()
     t.fd(-350)
     t.pensize(6)
     popdate(time.strftime(\'%Y-%m=%d+%H*\',time.localtime()))
     t.hideturtle()
main()

 

分类:

技术点:

相关文章:

  • 2022-01-14
  • 2021-10-05
  • 2022-01-26
  • 2021-12-30
  • 2021-12-25
  • 2021-12-29
猜你喜欢
  • 2022-01-03
  • 2021-12-21
  • 2022-02-08
  • 2021-11-24
  • 2022-02-01
  • 2021-06-06
相关资源
相似解决方案