资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

小猪佩奇代码java spring小猪佩奇

你看过哪些有意思的代码?

#include graphics.h

创新互联公司专注于勃利网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供勃利营销型网站建设,勃利网站制作、勃利网页设计、勃利网站官网定制、微信小程序开发服务,打造勃利网络公司原创品牌,更为您提供勃利网站排名全网营销落地服务。

#include conio.h

#include math.h

// 定义全局变量

int rosesize = 500;

int h = -250;

// 定义结构体

struct DOT

{

double x;

double y;

double z;

double r; // 红色

double g; // 绿**(蓝色) 通过 r 计算

};

// 计算点

bool calc(double a, double b, double c, DOT d)

{

double j, n, o, w, z;

if(c 60) // 花柄

{

d.x = sin(a * 7) * (13 + 5 / (0.2 + pow(b * 4, 4))) - sin(b) * 50;

d.y = b * rosesize + 50;

d.z = 625 + cos(a * 7) * (13 + 5 / (0.2 + pow(b * 4, 4))) + b * 400;

d.r = a * 1 - b / 2;

d.g = a;

return true;

}

double A = a * 2 - 1;

double B = b * 2 - 1;

if(A * A + B * B 1)

{

if(c 37) // 叶

{

j = (int(c) 1);

n = j ? 6 : 4;

o = 0.5 / (a + 0.01) + cos(b * 125) * 3 - a * 300;

w = b * h;

d.x = o * cos(n) + w * sin(n) + j * 610 - 390;

d.y = o * sin(n) - w * cos(n) + 550 - j * 350;

d.z = 1180 + cos(B + A) * 99 - j * 300;

d.r = 0.4 - a * 0.1 + pow(1 - B * B, -h * 6) * 0.15 - a * b * 0.4 + cos(a + b) / 5 + pow(cos((o * (a + 1) + (B 0 ? w : -w)) / 25), 30) * 0.1 * (1 - B * B);

d.g = o / 1000 + 0.7 - o * w * 0.000003;

return true;

}

if(c 32) // 花萼

{

c = c * 1.16 - 0.15;

o = a * 45 - 20;

w = b * b * h;

z = o * sin(c) + w * cos(c) + 620;

d.x = o * cos(c) - w * sin(c);

d.y = 28 + cos(B * 0.5) * 99 - b * b * b * 60 - z / 2 - h;

d.z = z;

d.r = (b * b * 0.3 + pow((1 - (A * A)), 7) * 0.15 + 0.3) * b;

d.g = b * 0.7;

return true;

}

// 花

o = A * (2 - b) * (80 - c * 2);

w = 99 - cos(A) * 120 - cos(b) * (-h - c * 4.9) + cos(pow(1 - b, 7)) * 50 + c * 2;

z = o * sin(c) + w * cos(c) + 700;

d.x = o * cos(c) - w * sin(c);

d.y = B * 99 - cos(pow(b, 7)) * 50 - c / 3 - z / 1.35 + 450;

d.z = z;

d.r = (1 - b / 1.2) * 0.9 + a * 0.1;

d.g = pow((1 - b), 20) / 4 + 0.05;

return true;

}

return false;

}

// 主函数

void main()

{

// 定义变量

short *zBuffer;

int x, y, z, zBufferIndex;

DOT dot;

// 初始化

initgraph(640, 480); // 创建绘图窗口

setbkcolor(WHITE); // 设置背景色为白色

cleardevice(); // 清屏

// 初始化 z-buffer

zBuffer = new short[rosesize * rosesize];

memset(zBuffer, 0, sizeof(short) * rosesize * rosesize);

for(int j = 0; j 2000 !_kbhit(); j++) // 按任意键退出

{

for(int i = 0; i 10000; i++) // 减少是否有按键的判断

if(calc(double(rand()) / RAND_MAX, double(rand()) / RAND_MAX, rand() % 46 / 0.74, dot))

{

z = int(dot.z + 0.5);

x = int(dot.x * rosesize / z - h + 0.5);

y = int(dot.y * rosesize / z - h + 0.5);

if (y = rosesize) continue;

zBufferIndex = y * rosesize + x;

if(!zBuffer[zBufferIndex] || zBuffer[zBufferIndex] z)

{

zBuffer[zBufferIndex] = z;

// 画点

int r = ~int((dot.r * h)); if (r 0) r = 0; if (r 255) r = 255;

int g = ~int((dot.g * h)); if (g 0) g = 0; if (g 255) g = 255;

int b = ~int((dot.r * dot.r * -80)); if (b 0) b = 0; if (b 255) b = 255;

putpixel(x + 50, y - 20, RGB(r, g, b));

}

}

Sleep(1);

}

// 退出

delete []zBuffer;

_getch();

closegraph();

}

猪妈妈在电脑上打了什么

小猪佩奇猪妈妈电脑上写的是一本书。

小猪佩奇想在电脑上玩快乐小鸡,但是猪妈妈要尽快把书完成,于是拒绝了小猪佩奇。猪爸爸正在厨房里准备午餐,佩奇问爸爸什么时候能玩电脑,爸爸说等妈妈把书写完就可以了。

猪妈妈书写完后松了一口气,出来吃午餐,并且让小猪佩奇玩电脑,过了一会后才反应过来自己电脑没有保存,一切努力都白费了。

《小猪佩奇》:

《小猪佩奇》又译作《粉红猪小妹》是由英国人阿斯特利、贝克、戴维斯创作、导演和制作的一部英国学前电视动画片,原名为《Peppa Pig》也是历年来最具潜力的学前儿童品牌。

故事围绕小猪佩奇与家人的愉快经历,借此宣扬传统家庭观念与友情,鼓励小朋友们体验生活。该动画片中文版由陈奕雯,符冲,张安琪,范楚绒,姜玉玲等人配音。

剧情简介:

四岁的佩奇和她的妈妈、爸爸以及弟弟乔治生活在一起。佩奇喜欢和她最好的朋友小羊苏西一起做游戏,喜欢郊游,喜欢去猪爷爷猪奶奶家,不过她最爱的是在泥坑里跳来跳去。她在探索新世界的过程中,总是充满欢声笑语。

小猪佩奇后面出现一堆鬼照片的代码

⼩猪佩奇代码# coding:utf-8

import turtle as t

t.screensize(400, 300, "pink")

t.pensize(4) # 设置画笔的⼤⼩

t.colormode(255) # 设置GBK颜⾊范围为0-255

t.color((255, 155, 192), "pink") # 设置画笔颜⾊和填充颜⾊(pink)

t.setup(840, 500) # 设置主窗⼝的⼤⼩为840*500

t.speed(10) # 设置画笔速度为10

# ⿐⼦

t.pu() # 提笔

t.goto(-100, 100) # 画笔前往坐标(-100,100)

t.pd() # 下笔

t.seth(-30) # 笔的⾓度为-30°

t.begin_fill() # 外形填充的开始标志

a = 0.4

for i in range(120):

if 0 = i 30 or 60 = i 90:

a = a + 0.08

t.lt(3) # 向左转3度

t.fd(a) # 向前⾛a的步长

else:

a = a - 0.08

t.lt(3)

t.fd(a)

t.end_fill() # 依据轮廓填充

t.pu() # 提笔

t.seth(90) # 笔的⾓度为90度

t.fd(25) # 向前移动25

t.seth(0) # 转换画笔的⾓度为0

t.fd(10)

t.pd()

t.pencolor(255, 155, 192) # 设置画笔颜⾊

t.seth(10)

t.begin_fill()

t.circle(5) # 画⼀个半径为5的圆

t.color(160, 82, 45) # 设置画笔和填充颜⾊

t.end_fill()

t.pu()

t.seth(0)

t.fd(20)

t.pd()

t.pencolor(255, 155, 192)

t.seth(10)

t.begin_fill()

t.circle(5)

t.color(160, 82, 45)

t.end_fill()

# 头

t.color((255, 155, 192), "pink")

t.pu()

t.seth(90)

t.fd(41)

t.seth(0)

t.fd(0)

t.pd()

t.begin_fill()

t.seth(180)

t.circle(300, -30) # 顺时针画⼀个半径为300,圆⼼⾓为30°的园

t.circle(100, -60)

t.circle(80, -100)

t.circle(150, -20)

t.circle(60, -95)

t.seth(161)

t.circle(-300, 15)

t.pu()

t.goto(-100, 100)

t.pd()

t.seth(-30)

a = 0.4

for i in range(60):

if 0 = i 30 or 60 = i 90:

a = a + 0.08

t.lt(3) # 向左转3度

t.fd(a) # 向前⾛a的步长

else:

a = a - 0.08

t.lt(3)

t.fd(a)

t.end_fill()

t.color((255, 155, 192), "pink") t.pu()

t.seth(90)

t.fd(-7)

t.seth(0)

t.fd(70)

t.pd()

t.begin_fill()

t.seth(100)

t.circle(-50, 50)

t.circle(-10, 120)

t.circle(-50, 54)

t.end_fill()

t.pu()

t.seth(90)

t.fd(-12)

t.seth(0)

t.fd(30)

t.pd()

t.begin_fill()

t.seth(100)

t.circle(-50, 50)

t.circle(-10, 120)

t.circle(-50, 56)

t.end_fill()

# 眼睛

t.color((255, 155, 192), "white") t.pu()

t.seth(90)

t.fd(-20)

t.seth(0)

t.fd(-95)

t.pd()

t.begin_fill()

t.circle(15)

t.end_fill()

t.color("black")

t.pu()

t.seth(90)

t.fd(12)

t.seth(0)

t.fd(-3)

t.pd()

t.begin_fill()

t.circle(3)

t.end_fill()

t.color((255, 155, 192), "white") t.pu()

t.seth(90)

t.fd(-25)

t.seth(0)

t.fd(40)

t.pd()

t.begin_fill()

t.circle(15)

t.end_fill()

t.color("black")

t.pu()

t.seth(90)

t.fd(12)

t.seth(0)

t.fd(-3)

t.pd()

t.begin_fill()

t.circle(3)

t.end_fill()

# 腮

t.color((255, 155, 192))

t.pu()

t.seth(90)

t.fd(-95)

t.seth(0)

t.fd(65)

t.pd()

t.begin_fill()

t.circle(30)

t.end_fill()

# 嘴

t.color(239, 69, 19)

t.circle(40, 80)

# ⾝体

t.color("pink", (255, 99, 71))

t.pu()

t.seth(90)

t.fd(-20)

t.seth(0)

t.fd(-78)

t.pd()

t.begin_fill()

t.seth(-130)

t.circle(100, 10)

t.circle(300, 30)

t.seth(0)

t.fd(230)

t.seth(90)

t.circle(300, 30)

t.circle(100, 3)

t.color((255, 155, 192), (255, 100, 100)) t.seth(-135)

t.circle(-80, 63)

t.circle(-150, 24)

t.end_fill()

# ⼿

t.color((255, 155, 192))

t.pu()

t.seth(90)

t.fd(-40)

t.seth(0)

t.fd(-27)

t.pd()

t.seth(-160)

t.circle(300, 15)

t.pu()

t.seth(90)

t.fd(15)

t.seth(0)

t.fd(0)

t.pd()

t.seth(-10)

t.circle(-20, 90)

t.pu()

t.seth(90)

t.fd(30)

t.seth(0)

t.fd(237)

t.pd()

t.seth(-20)

t.circle(-300, 15)

t.pu()

t.seth(90)

t.fd(20)

t.seth(0)

t.fd(0)

t.pd()

t.seth(-170)

t.circle(20, 90)

# 脚

t.pensize(10)

t.color((240, 128, 128))

t.pu()

t.seth(90)

t.fd(-75)

t.seth(0)

t.fd(-180)

t.pd()

t.seth(-90)

t.fd(40)

t.seth(-180)

t.color("red")

t.pensize(15)

t.fd(20)

t.pensize(10)

t.color((240, 128, 128))

t.pu()

t.seth(90)

t.pensize(15)

t.fd(20)

# 尾巴

t.pensize(4)

t.color((255, 155, 192)) t.pu()

t.seth(90)

t.fd(70)

t.seth(0)

t.fd(95)

t.pd()

t.seth(0)

t.circle(70, 20)

t.circle(10, 330)

t.circle(70, 30)

t.done()

5.9

百度文库VIP限时优惠现在开通,立享6亿+VIP内容

立即获取

小猪佩奇代码

⼩猪佩奇代码# coding:utf-8

import turtle as t

t.screensize(400, 300, "pink")

t.pensize(4) # 设置画笔的⼤⼩

t.colormode(255) # 设置GBK颜⾊范围为0-255

t.color((255, 155, 192), "pink") # 设置画笔颜⾊和填充颜⾊(pink)

t.setup(840, 500) # 设置主窗⼝的⼤⼩为840*500

t.speed(10) # 设置画笔速度为10


网页名称:小猪佩奇代码java spring小猪佩奇
文章转载:http://cdkjz.cn/article/ddspceo.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220