posted on 2023-05-21 17:14 read(303) comment(0) like(0) collect(0)
Table of contents
Hello, friends, good evening! The blogger turned 20 years old two days ago (starting to go to Sanliao woo woo woo), and has received many blessings from friends these days. The romantic little blogger wants to give everyone a different birthday cake , Thank you all for supporting me!
Before making the cake, we need to find a good-looking plate~
def ground_floor(width,height,colors_a,h): t.penup() t.goto(width, h) t. pendown() t.begin_fill() t.fillcolor(colors_a[0]) for i in range(360): x=draw_x(width, i) y=draw_y(height,i)+h t.goto(x,y) t.end_fill() t.begin_fill() t.fillcolor(colors_a[1]) for i in range(180): x=draw_x(width, -i) y=draw_y(height+10,-i)+h t.goto(x,y) for i in range(180,360): x=draw_x(width, i) y=draw_y(height,i)+h t.goto(x,y) t.end_fill()
After finding a plate we like, we can make the cake layer by layer!
def each_piece(width,height_1,height_2,colors_b,h): t.penup() t.goto(width,h) t. pendown() t.begin_fill() t.fillcolor(colors_b[0]) for i in range(360): x=draw_x(width, i) y=draw_y(height_1,i)+h t.goto(x,y) t.end_fill() t.begin_fill() t.fillcolor(colors_b[0]) for i in range(540): x=draw_x(width, i) y=draw_y(height_1,i)+height_2+h t.goto(x,y) t.goto(-width,h) t.end_fill() t.penup() t.goto(width-10,height_2+h) t. pendown() t.begin_fill() t.fillcolor(colors_b[1]) for i in range(360): x=draw_x(width - 10, i) y=draw_y(height_1*0.9,i)+height_2+h t.goto(x,y) t.end_fill() t.penup() t.goto(width,h) t. pendown() t.begin_fill() t.fillcolor(colors_b[2]) for i in range(180): x=draw_x(width, -i) y=draw_y(height_1,-i)+10+h t.goto(x,y) t.goto(-width,h) for i in range(180,360): x=draw_x(width, i) y=draw_y(height_1,i)+h t.goto(x,y) t.end_fill() t.penup() t.goto(width,height_2+h) t. pendown() t.begin_fill() t.fillcolor(colors_b[3]) for i in range(1800): x=draw_x(width, 0.1 * i) y=draw_y(-height_1*0.3,i)+h t.goto(x,y) t.goto(-width,height_2+h) for i in range(180,360): x=draw_x(width, i) y=draw_y(height_1,i)+height_2+h t.goto(x,y) t.end_fill()
Don't forget to make candles after the cake is finished~
Most importantly, don't forget to write down your best wishes to her!
t.write("Happy Birthday!", font=("Curlz MT", 50))
Author:Poison
link:http://www.pythonblackhole.com/blog/article/25270/10da55f77532a9174f14/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!