欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python七夕浪漫表白源碼

 更新時(shí)間:2019年04月05日 11:54:18   作者:計(jì)科李昂  
這篇文章主要為大家分享了python七夕浪漫表白源碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下,祝大家表白成功

本文實(shí)例為大家分享了python七夕浪漫表白的具體代碼,供大家參考,具體內(nèi)容如下

from turtle import *
from time import sleep
 
def go_to(x, y):
  up()
  goto(x, y)
  down()
 
 
def big_Circle(size): #函數(shù)用于繪制心的大圓
  speed(1)
  for i in range(150):
    forward(size)
    right(0.3)
 
def small_Circle(size): #函數(shù)用于繪制心的小圓
  speed(1)
  for i in range(210):
    forward(size)
    right(0.786)
 
def line(size):
  speed(1)
  forward(51*size)
 
def heart( x, y, size):
  go_to(x, y)
  left(150)
  begin_fill()
  line(size)
  big_Circle(size)
  small_Circle(size)
  left(120)
  small_Circle(size)
  big_Circle(size)
  line(size)
  end_fill()
 
def arrow():
  pensize(10)
  setheading(0)
  go_to(-400, 0)
  left(15)
  forward(150)
  go_to(339, 178)
  forward(150)
 
def arrowHead():
  pensize(1)
  speed(1)
  color('red', 'red')
  begin_fill()
  left(120)
  forward(20)
  right(150)
  forward(35)
  right(120)
  forward(35)
  right(150)
  forward(20)
  end_fill()
 
 
def main():
  pensize(2)
  color('red', 'pink')
  #getscreen().tracer(30, 0) #取消注釋后,快速顯示圖案
  heart(200, 0, 1)     #畫(huà)出第一顆心,前面兩個(gè)參數(shù)控制心的位置,函數(shù)最后一個(gè)參數(shù)可控制心的大小
  setheading(0)       #使畫(huà)筆的方向朝向x軸正方向
  heart(-80, -100, 1.5)   #畫(huà)出第二顆心
  arrow()          #畫(huà)出穿過(guò)兩顆心的直線
  arrowHead()        #畫(huà)出箭的箭頭
  go_to(400, -300)
  write("author:520Python", move=True, align="left", font=("宋體", 30, "normal"))
  done()
 
main()

效果如下:

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論