极客小将

您现在的位置是:首页 » scratch编程资讯

资讯内容

我用Scratch和Python编程祝福送给您Merry Christmas!

极客小将2020-11-08-
圣诞节快乐 Merry Christmas 借着圣诞节的吉利,诉说心中的惦记。 伴随圣诞节的欢喜,奉送永恒的支持, 把最温馨的祝愿给您, 愿这个冬天饱含暖意。

圣诞节快乐

Merry Christmas

借着圣诞节的吉利,诉说心中的惦记。

伴随圣诞节的欢喜,奉送永恒的支持,

把最温馨的祝愿给您,

愿这个冬天饱含暖意。

A Merry Christmas and a wonderful New Year.
  圣诞快乐,新年好!

  May you have the best Christmas ever.
  愿你度过最美好的圣诞节!

  Thinking of you and wishing you a beautiful Christmas season.
  美丽的圣诞节之际,谨致我的思念与祝福。

  Here is wishing you all a Merry Christmas and a New Year bright with joy and success.
  祝圣诞快乐,新年充满幸福和成功。

  Wishing you and your family a very merry Christmas.
  祝福您及您的家人圣诞快乐。

  Wishing you a song in your heart at Christmas and blessings all year long.
  圣诞之际,祝你心中有首快乐的歌,新年快乐!

upload/article/images/2020-11-08/b1ab1626e5fce03238283cbc31e9fb1f.jpg

圣诞节到了!

用编程的方式

Scratch编程动画与Python画圣诞树吧

Scratch编程动画送上圣诞祝福

部分角色代码

upload/article/images/2020-11-08/dec7f789456ac1da785376807d13454b.jpg

upload/article/images/2020-11-08/aaadc96ac9edc33139c4d42ff529542c.jpg

Python画圣诞树送上祝福

upload/article/images/2020-11-08/f6ac05bf6c0573c353f7b697a70b8a31.jpg

与Scratch相比,Python属高级语言。

1、入门圣诞树

upload/article/images/2020-11-08/b49b747da8aad636c782181998b6de91.jpg

是不是感觉Python太简单LOW了?

代码如下:

height = 5

stars = 1

for i in range(height):

    print((' ' * (height - i)) + ('*' * stars))

    stars += 2

print((' ' * height) + ' |')

2、进阶圣诞树

upload/article/images/2020-11-08/009b61dee18064a520068ae66e0fbe8b.jpg

额,漂亮了许多。

部分代码如下:

import turtle

screen = turtle.Screen()

screen.setup(800,600)

circle = turtle.Turtle()

circle.shape('circle')

circle.color('red')

circle.speed('fastest')

circle.up()

square = turtle.Turtle()

square.shape('square')

square.color('green')

square.speed('fastest')

square.up()

circle.goto(0,280)

circle.stamp()

k = 0

for i in range(1, 17):

    y = 30*i

    for j in range(i-k):

。。。。。。

需要完整源代码的在公众号后台留言

3、高级圣诞树

upload/article/images/2020-11-08/ca8916affa24d30e6b9ce82801f55188.jpg

哇,好漂亮喔!

部分代码如下:

from turtle import *

import random

import time

n = 80.0

speed("fastest")

screensize(bg='seashell')

left(90)

forward(3*n)

color("orange", "yellow")

begin_fill()

left(126)

for i in range(5):

    forward(n/5)

    right(144)

    forward(n/5)

    left(72)

网友点评

共有5条评论来说两句吧...

在线客服