一、Html的小猪佩奇画法

<!DOCTYPE html>
<html>
<head><title>用css画一个小猪佩奇</title><style type="text/css">div {position: absolute;transform-origin: left top;}
.pig_container {width: 800px;height: 800px;top: 0;left: 50px;
}.pig_head {width: 300px;height: 200px;top: 100px;left: 100px;border-radius: 95% 50% 50% 50%/ 87% 80% 68% 50%;border: 6px solid #ef96c2;background-color: #ffb3da;transform: rotate(30deg);z-index: 100;box-sizing: border-box;
}
.pig_head_white_left_bottom {width: 200px;height: 154px;bottom: -7px;left: -38px;background-color: #fff;box-sizing: border-box;
}
.pig_head_white_left_top {width: 200px;height: 66px;bottom: 84px;background-color: #ffb3da;box-sizing: border-box;top: 166px;left: 134px;transform: rotate(34deg);z-index: 103;
}
.left_eye, .right_eye, .face, .mouth {z-index: 104;
}
.pig_nose {width: 51px;height: 70px;top: 147px;left: 107px;border-radius: 72% 72% 72% 72%/ 72% 72% 72% 72%;border: 6px solid #ef96c2;background-color: #ffb3da;transform: rotate(36deg);z-index: 103;box-sizing: border-box;
}
.pig_nose_bottom {width: 88px;height: 13px;top: 209px;left: 84px;border-radius: 50% 50% 50% 50%/ 0% 0% 100% 100%;border: 6px solid #ef96c2;background-color: #ffb3da;transform: rotate(35deg);z-index: 102;box-sizing: border-box;border-top-color: #ffb3da;
}
.pig_jaw {width: 97px;height: 104px;top: 249px;left: 141px;border-radius: 0% 0% 0% 76%/ 0% 0% 0% 74%;border: 6px solid #ef96c2;background-color: #ffb3da;transform: rotate(22deg);z-index: 100;box-sizing: border-box;border-top-color: #ffb3da;border-right-color: #ffb3da;
}
.pig_jaw_right {width: 13px;height: 6px;background-color: #ef96c2;top: 373px;left: 186px;transform: rotate(19deg);z-index: 100;
}
.left_eye_bg {width: 29px;height: 29px;top: 177px;left: 170px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;border: 6px solid #fff;background-color: #fff;z-index: 101;box-sizing: border-box;
}
.left_eye_ball {width: 10px;height: 10px;top: 181px;left: 171px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;border: 6px solid #000;background-color: #000;z-index: 101;box-sizing: border-box;
}
.left_eye_border {width: 34px;height: 34px;top: 174px;left: 166px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;border: 6px solid #ef96c2;background-color: transparent;z-index: 101;box-sizing: border-box;
}.right_eye_bg {width: 28px;height: 28px;top: 194px;left: 205px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;border: 6px solid #fff;background-color: #fff;z-index: 101;box-sizing: border-box;
}
.right_eye_ball {width: 10px;height: 10px;top: 199px;left: 208px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;border: 6px solid #000;background-color: #000;z-index: 101;box-sizing: border-box;
}
.right_eye_border {width: 35px;height: 37px;top: 191px;left: 202px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;border: 6px solid #ef96c2;background-color: transparent;z-index: 101;box-sizing: border-box;
}.mouth_bottom {width: 97px;height: 45px;top: 273px;left: 154px;border-radius: 50% 50% 50% 50%/ 0% 0% 100% 100%;border: 6px solid #d44b81;background-color: #000;z-index: 101;box-sizing: border-box;transform: rotate(19deg);
}
.mouth_middle {width: 98px;height: 27px;top: 272px;left: 154px;border-radius: 0% 0% 50% 50%/ 0% 0% 100% 100%;border: 6px solid #d44b81;background-color: #ffb3da;z-index: 101;box-sizing: border-box;transform: rotate(19deg);border-top-color: #ffb3da;
}
.mouth_top {width: 135px;height: 66px;top: 231px;left: 149px;border-radius: 50% 50% 50% 50%/ 0% 0% 100% 100%;background-color: #ffb3da;z-index: 101;transform: rotate(13deg);}
.face {width: 49px;height: 59px;top: 243px;left: 269px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;background-color: #ff96ce;transform: rotate(26deg);
}.nose_kong_left {width: 12px;height: 12px;top: 179px;left: 93px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;background-color: #da6c9b;z-index: 104;
}
.nose_kong_right {width: 12px;height: 12px;top: 182px;left: 109px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;background-color: #da6c9b;z-index: 104;
}.ear_left {width: 24px;height: 52px;top: 126px;left: 226px;border: 6px solid #ef96c2;border-radius: 50% 50% 50% 50%/ 35% 40% 50% 50%;background-color: #ffb3da;z-index: 99;transform: rotate(18deg);
}
.ear_right {width: 24px;height: 52px;top: 150px;left: 280px;border: 6px solid #ef96c2;border-radius: 50% 50% 50% 50%/ 35% 40% 50% 50%;background-color: #ffb3da;z-index: 99;transform: rotate(36deg);
}.pig_body_bottom {width: 215px;height: 197px;top: 305px;left: 108px;border: 6px solid #e33b32;border-radius: 50% 50% 50% 50%/ 100% 100% 0% 0%;background-color: #eb5b50;z-index: 99;
}.hand_left_middle {width: 78px;height: 12px;top: 432px;left: 63px;border-radius: 100% 100% 100% 17%/ 100% 90% 16% 90%;background-color: #ffbadf;z-index: 99;transform: rotate(-35deg);
}
.hand_left_top {width: 28px;height: 9px;top: 415px;left: 63px;border-radius: 100% 100% 100% 35%/ 100% 90% 16% 90%;background-color: #ffbadf;z-index: 99;
}
.hand_left_bottom {width: 20px;height: 9px;top: 420px;left: 93px;border-radius: 60% 59% 65% 90%/ 100% 90% 89% 90%;background-color: #ffbadf;z-index: 99;transform: rotate(98deg);
}.hand_right_middle {width: 79px;height: 11px;top: 374px;left: 309px;border-radius: 100% 100% 15% 17%/ 99% 92% 90% 90%;background-color: #ffbadf;z-index: 99;transform: rotate(28deg);
}
.hand_right_top {width: 28px;height: 10px;top: 397px;left: 350px;border-radius: 100% 100% 15% 17%/ 99% 92% 90% 90%;background-color: #ffbadf;z-index: 99;transform: rotate(-7deg);
}
.hand_right_bottom {width: 28px;height: 11px;top: 395px;left: 356px;border-radius: 100% 100% 62% 17%/ 99% 92% 90% 90%;background-color: #ffbadf;z-index: 99;transform: rotate(69deg);
}
.left_foot {width: 11px;height: 52px;top: 507px;left: 175px;border-radius: 100% 100% 100% 100%/ 50% 50% 21% 20%;background-color: #ffbadf;z-index: 99;
}
.left_shoes {width: 51px;height: 14px;top: 553px;left: 138px;border-radius: 58% 187% 180% 50%/ 130% 123% 113% 100%;background-color: #000;z-index: 99;transform: rotate(0deg);
}
.right_foot {left: 268px;
}
.right_shoes {left: 230px;
}
.pig_shadow {width: 240px;height: 47px;top: 535px;left: 101px;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;background-color: rgba(171, 171, 171, 0.7);transform: rotate(-1deg);
}
.tail_left {width: 19px;height: 8px;top: 472px;left: 330px;border-radius: 50% 50% 50% 50%/ 0% 0% 100% 100%;transform: rotate(-9deg);background-color: #ffbadf;z-index: 99;
}
.tail_left_blank {width: 30px;height: 15px;top: 466px;left: 332px;border-radius: 50% 50% 50% 50%/ 0% 0% 100% 100%;transform: rotate(-36deg);background-color: #fff;z-index: 99;
}
.tail_right {width: 21px;height: 5px;top: 451px;left: 343px;border-radius: 0% 0% 51% 50%/ 0% 0% 100% 100%;transform: rotate(31deg);background-color: #fff;z-index: 99;border: 8px solid #ffbadf;border-top-color: #fff;
}
.tail_blank {width: 36px;height: 21px;top: 437px;left: 351px;transform: rotate(34deg);background-color: #fff;z-index: 99;
}
.tail_middle {width: 7px;height: 11px;top: 450px;left: 336px;border: 8px solid #ffbadf;border-radius: 50% 50% 50% 50%/ 50% 50% 50% 50%;background-color: #fff;z-index: 99;
}
.tail_circle {width: 17px;height: 8px;top: 475px;left: 358px;border-radius: 36% 37% 62% 63%/ 99% 92% 90% 90%;background-color: #ffbadf;z-index: 99;transform: rotate(-40deg);
}</style>
</head>
<body><div class="pig_container"><!-- 尾巴 --><div class="tail_left"></div><div class="tail_right"></div><div class="tail_blank"></div><div class="tail_middle"></div><div class="tail_circle"></div><!-- 底部阴影 --><div class="pig_shadow"></div><!-- 左脚 --><div class="left_foot"></div><div class="left_foot right_foot"></div><!-- 左鞋 --><div class="left_shoes"></div><div class="left_shoes right_shoes"></div><!-- 左手 --><div><div class="hand_left_top"></div><div class="hand_left_bottom"></div><div class="hand_left_middle"></div></div><!-- 身体 --><div class="pig_body_bottom"></div><!-- 右手 --><div><div class="hand_right_top"></div><div class="hand_right_bottom"></div><div class="hand_right_middle"></div></div><!-- 猪头 --><div><!-- 耳朵 --><div class="ear_left"></div><div class="ear_right"></div><div class="pig_head"><div class="pig_head_white_left_bottom"></div></div><div class="pig_head_white_left_top"></div><!-- 鼻子 --><div class="pig_nose"></div><!-- 下巴 --><div class="pig_jaw"></div><div class="pig_jaw_right"></div><div class="pig_nose_bottom"></div><!-- 鼻孔 --><div class="nose_kong_left"></div><div class="nose_kong_right"></div><!-- 左眼 --><div class="left_eye"><div class="left_eye_bg"></div><div class="left_eye_ball"></div><div class="left_eye_border"></div></div><!-- 右眼 --><div class="right_eye"><div class="right_eye_bg"></div><div class="right_eye_ball"></div><div class="right_eye_border"></div></div><!-- 嘴巴 --><div class="mouth"><div class="mouth_bottom"></div><div class="mouth_middle"></div><div class="mouth_top"></div></div><!-- 脸颊 --><div class="face"></div></div>
</div></body>
</html>

二.使用canvas画小猪佩奇

<canvas id="myCanvas" width="400" height="500" style="border: 1px solid #808080;  margin-left:400px;" onmousemove="cnvs_getCoordinates(event);" onmouseout="cnvs_clearCoordinates();">看不见我!!!</canvas><script>FunPig();//小猪佩奇function FunPig() {var ct = document.getElementById('myCanvas').getContext('2d');ct.beginPath()  //开始ct.lineWidth = "3";ct.strokeStyle = "pink";//起点ct.moveTo(75, 15);         //控制范围  结束//context.quadraticCurveTo(cpx, cpy, x, y);ct.quadraticCurveTo(220, 26, 220, 160);    //第一步ct.moveTo(219, 141);ct.quadraticCurveTo(240, 300, 70, 250);    //第三步//   ct.stroke()ct.moveTo(76, 253);ct.quadraticCurveTo(16, 220, 74, 111);ct.moveTo(73, 112);ct.quadraticCurveTo(60, 112, 31, 83);ct.moveTo(31, 83);ct.quadraticCurveTo(23, 26, 75, 15);ct.moveTo(75, 15);ct.quadraticCurveTo(108, 32, 99, 61);ct.moveTo(99, 61);ct.quadraticCurveTo(66, 101, 31, 81);ct.stroke();//  鼻子的两个孔ct.beginPath();ct.arc(48, 48, 6, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();ct.beginPath();ct.arc(77, 48, 6, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();//耳朵//左耳朵ct.beginPath();ct.moveTo(149, 31);ct.quadraticCurveTo(155, 0, 189, 6);ct.moveTo(189, 6);ct.quadraticCurveTo(188, 30, 170, 44);//右耳朵ct.moveTo(188, 59);ct.quadraticCurveTo(198, 24, 222, 32);ct.moveTo(222, 32);ct.quadraticCurveTo(255, 54, 199, 75);ct.stroke();//嘴巴ct.beginPath();ct.arc(93, 178, 30, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();//眼睛ct.beginPath();ct.strokeStyle = " #BDBDBD";ct.arc(141, 67, 14, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();ct.beginPath();ct.strokeStyle = "#000000";ct.arc(136, 64, 6, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();ct.beginPath();ct.strokeStyle = " #BDBDBD";ct.arc(170, 88, 14, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();ct.beginPath();ct.strokeStyle = "#000000";ct.fillStyle = "#FF0000";ct.arc(165, 87, 6, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();// 粉红嘴腮ct.beginPath();ct.strokeStyle = " #CD8C95";ct.arc(178, 147, 20, 0 * Math.PI, 2.5 * Math.PI);ct.stroke();//身体ct.beginPath();ct.strokeStyle = "red";ct.moveTo(195, 245);ct.quadraticCurveTo(215, 215, 244, 410);ct.moveTo(244, 410);ct.quadraticCurveTo(244, 410, 38, 410);ct.moveTo(38, 410);ct.quadraticCurveTo(11, 410, 76, 251);ct.stroke();//两只手ct.beginPath();ct.strokeStyle = "pink";ct.moveTo(58, 294);ct.quadraticCurveTo(50, 288, 12, 238);ct.moveTo(56, 300);ct.quadraticCurveTo(56, 300, 16, 260);ct.lineTo(3, 269);ct.lineTo(11, 250);ct.lineTo(3, 228);ct.lineTo(15, 241);ct.stroke();//右手ct.beginPath();ct.moveTo(223, 292);ct.quadraticCurveTo(266, 288, 287, 271);ct.moveTo(287, 271);ct.quadraticCurveTo(236, 233, 279, 245);ct.moveTo(279, 245);ct.quadraticCurveTo(255, 200, 295, 247);ct.moveTo(295, 247);ct.quadraticCurveTo(288, 200, 306, 226);ct.moveTo(306, 226);ct.quadraticCurveTo(311, 250, 308, 248);ct.moveTo(308, 248);ct.quadraticCurveTo(344, 200, 334, 245);ct.moveTo(334, 245);ct.quadraticCurveTo(311, 280, 300, 280);ct.moveTo(300, 280);ct.quadraticCurveTo(311, 280, 224, 303);ct.stroke();ct.beginPath();ct.moveTo(94, 409);ct.quadraticCurveTo(94, 409, 96, 451);ct.moveTo(96, 451);ct.quadraticCurveTo(53, 429, 56, 461);ct.moveTo(56, 461);ct.quadraticCurveTo(56, 461, 107, 464);   ct.lineTo(106, 409);ct.moveTo(183, 411);           ct.lineTo(182, 447);          ct.quadraticCurveTo(124, 434, 136, 464);          ct.lineTo(196, 463);ct.lineTo(195, 409);ct.stroke();ct.beginPath();ct.lineWidth = "7";ct.strokeStyle = "pink";ct.lineCap = "round";ct.moveTo(238,360);ct.quadraticCurveTo(266, 380, 267, 360);ct.quadraticCurveTo(254, 330, 250, 380);ct.quadraticCurveTo(254, 420, 290, 369);ct.stroke();}</script>

三.用CSS画小猪佩奇

猪头轮廓样式代码:

position: absolute;z-index: 100;box-sizing: border-box;width: 300px;height: 200px;top: 100px;left: 100px;border-radius: 92% 50% 50% 50%/ 87% 80% 68% 50%;border: 6px solid #ef96c2;background-color: #ffb3da;transform: rotate(30deg);transform-origin: left top;

嘴巴
三个半椭圆依次叠加即可~同样是图层遮盖来实现。
五肢
其实画到这里基本上对 border-radius 的使用很熟练了,参数的设置也大概心中有数,剩下的也就工作量的问题了。
合体
其余的部分画法大同小异,五官的摆放要特别注意比例和尺寸,比如身体就很容易因为大小不合适而成了胖佩奇/瘦佩奇,这里可以借助 photoshop 的标尺。同时用取色器拿到佩奇各部分颜色,接下来就是整体的调试了。

<div class="pig_container"><!-- 尾巴 --><div class="tail_left"></div><div class="tail_right"></div><div class="tail_blank"></div><div class="tail_middle"></div><div class="tail_circle"></div><!-- 底部阴影 --><div class="pig_shadow"></div><!-- 左脚 --><div class="left_foot"></div><div class="left_foot right_foot"></div><!-- 左鞋 --><div class="left_shoes"></div><div class="left_shoes right_shoes"></div><!-- 左手 --><div><div class="hand_left_top"></div><div class="hand_left_bottom"></div><div class="hand_left_middle"></div></div><!-- 身体 --><div class="pig_body_bottom"></div><!-- 右手 --><div><div class="hand_right_top"></div><div class="hand_right_bottom"></div><div class="hand_right_middle"></div></div><!-- 猪头 --><div><!-- 耳朵 --><div class="ear_left"></div><div class="ear_right"></div><div class="pig_head"><div class="pig_head_white_left_bottom"></div><div class="pig_head_white_left_top"></div></div><!-- 鼻子 --><div class="pig_nose"></div><!-- 下巴 --><div class="pig_jaw"></div><div class="pig_jaw_right"></div><div class="pig_nose_bottom"></div><!-- 鼻孔 --><div class="nose_kong_left"></div><div class="nose_kong_right"></div><!-- 左眼 --><div class="left_eye"><div class="left_eye_bg"></div><div class="left_eye_ball"></div><div class="left_eye_border"></div></div><!-- 右眼 --><div class="right_eye"><div class="right_eye_bg"></div><div class="right_eye_ball"></div><div class="right_eye_border"></div></div><!-- 嘴巴 --><div class="mouth"><div class="mouth_bottom"></div><div class="mouth_middle"></div><div class="mouth_top"></div></div><!-- 脸颊 --><div class="face"></div></div>
</div>

四.用python的turtle进行画图

# coding:utf-8import turtle as t
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.08t.lt(3) #向左转3度t.fd(a) #向前走a的步长else:a=a-0.08t.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.08t.lt(3) #向左转3度t.fd(a) #向前走a的步长else:a=a-0.08t.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.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(-100)
t.pd()
t.seth(-80)
t.circle(30,40)
t.circle(40,80)
#身体
t.color("red",(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("black")
t.pensize(15)
t.fd(20)
t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(40)
t.seth(0)
t.fd(90)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
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)

转载文章出处:原文地址

代码实现小猪佩奇(最社会的代码)相关推荐

  1. 使用canvas 代码画小猪佩奇

    使用canvas 代码画小猪佩奇 最近不是小猪佩奇很火嘛!!! 前几天 在知乎 看见了别人大佬用python写的 小猪佩奇,  顿时想学 ,可是 自己 没学过python(自己就好爬爬图片,,,,几个 ...

  2. 用python画小猪佩奇的编码_如何用Python代码画小猪佩奇

    Python语言的功能太强大了,可以制作出很多想想的作品来,不信吗?用Python代码还可以画出小猪佩奇,代码其实很简单的,下面,就将几个关键步骤代码分享出来. 怎么用Python代码画小猪佩奇? 首 ...

  3. Python代码画小猪佩奇--turtle绘图

    Python代码小猪佩奇–turtle绘图 效果图 代码 import time import turtle as tt.pensize(4) # 设置画笔的大小 t.colormode(255) # ...

  4. 儿童游戏html5,节日H5丨提前了解下,比小猪佩奇更社会的儿童节H5游戏

    原标题:节日H5丨提前了解下,比小猪佩奇更社会的儿童节H5游戏 掐指一算熊孩子的节日快到了 当下二胎市场的经济实力不容小觑 相信各位品牌主大大们已经开始有计划做 儿童节品牌营销方案了 下面推荐 9个儿 ...

  5. python代码画小猪佩奇_用 Python 画一个小猪佩奇和哆啦 A 梦

    0 前言 最近发现了很有意思的东西,有人用 turtle 这个库画了一个小猪佩奇,跑去 GitHub 看了一下代码,发现写这个的人真的很有耐心,居然能写下来. 再找了找,发现有人还画了哆啦 A 梦, ...

  6. python代码画小猪佩奇动画片全集_使用python画个小猪佩奇的示例代码

    本文给大家较详细的介绍了使用python画个小猪佩奇的示例代码,感兴趣的朋友一起看看吧 基本原理 选好画板大小,设置好画笔颜色.粗细,定位好位置,依次画鼻子.头.耳朵.眼睛.腮.嘴.身体.手脚.尾巴, ...

  7. python,你也和小猪佩奇一样社会了!

    还记得,曾几何时,python是一门非常强大的语言,很单纯,也很快乐,曾经python对我的唯一用途就是网络爬虫. 但是, 随着时间的推移,python变的越来越社会,他的科学计算库也崛起了,自然语言 ...

  8. 小猪佩奇python_一段代码画出小猪佩奇社会人 Python

    复制内容到剪贴板 代码:# coding:utf-8 import turtle as t t.pensize(4) t.hideturtle() t.colormode(255) t.color(( ...

  9. Python画樱花树代码和小猪佩奇

    樱花树: 效果图: import turtle as T import random import time# 画樱花的躯干(60,t) def Tree(branch, t):time.sleep( ...

最新文章

  1. 张仰彪第二排序法_C语言中的最常用的两种排序算法你知道吗?
  2. numpy 筛选面积最大
  3. sqlite 日期时间类型学习1
  4. JPA时间注解(转)
  5. 雷死人不偿命-----六年级小学生的字条
  6. 在Latex使用條列式清單itemize , enumerate , description
  7. 信息学奥赛一本通(1109:开关灯)
  8. 利用搜索引擎实现关键词爬取内容
  9. Django 输出二维码
  10. java设计模式模式组合_Java设计模式---组合模式
  11. 九宫格拼图小游戏代码html,js实现九宫格拼图小游戏.pdf
  12. ubuntu安装anjuta
  13. 电商开发之商品属性分类
  14. CDH-TXKT-集群的维护
  15. cubase外放有声音耳机没声音_为何CUBASE耳机内没有声音
  16. 源支付聚合免签支付系统
  17. 【DB笔试面试608】在Oracle中,如何使用STA来生成SQL Profile?
  18. html实现微信公众号,H5在微信公众号的下拉刷新实现
  19. pyinstaller 打包pyqt5程序出现环境变量错误问题
  20. Scratch3.0 运动和绘图

热门文章

  1. ThinkPHP6 批量字段查询
  2. Android ViewHolder模式示例
  3. Python3实现ICMP远控后门(下)之“Boss”出场
  4. 物联网设备连接的下一个引爆点:4G Cat.1
  5. 华为荣耀10是Android,华为、荣耀公布升级安卓10.0名单,来看看有没有你的机型吧...
  6. 南京是六朝文学的中心
  7. Redis 绑定Ip和设置密码
  8. Excel学习日记:L28-利用随机函数制作抽奖、班级分组
  9. [Termux] 几个有意思的小软件包
  10. 网络简单监控邮件告警