趣味端午节,程序猿特殊的献礼

在这里插入图片描述

前言

2022年6月3日,每年一度的端午节来临了,在这里程序猿用特殊的表达来献礼端午节

🚀 1.端午节起源

端午节也叫端阳节、重午节、五月节、女儿节、诗人节是我国所有传统节日中叫法最多的节日.。
端午节,是中华民族的传统节日,在我国已经存在了上千年。
西晋《风土记》说
“仲夏端午。端者,初也。”
这是“端午”一词最早的出处
🚩关于端午节的由来,有这样几种说法↓

❤️❤️❤️ 纪念屈原

在这里插入图片描述

公元前278年,秦军攻破楚都。屈原眼看自己的祖国被侵略,心如刀割,于五月五日抱石投汨罗江身死。屈原死后,楚国百姓哀痛异常,纷纷涌到汨罗江边去凭吊屈原,就有了端午龙舟竞渡、吃粽子的风俗。

❤️❤️❤️ 纪念伍子胥

在这里插入图片描述

伍子胥建议应彻底消灭越国,吴王夫差不听。子胥便对邻舍人说:“我死后,将我眼睛挖出悬挂在吴京之东门上,以看越国军队入城灭吴”,便自刎而死。因此相传端午节亦为纪念伍子胥之日。

❤️❤️❤️ 纪念孝女曹娥
在这里插入图片描述

曹娥是东汉上虞人,父亲溺于江中,数日不见尸体,当时孝女曹娥年仅十四岁,昼夜沿江号哭。过了十七天,在五月五日也投江,五日后抱出父尸。后人为纪念曹娥的孝节,在曹娥投江之处兴建曹娥庙。

❤️❤️❤️ 恶日
在这里插入图片描述

在先秦时代,普遍认为五月是个毒月,五日是恶日,相传这天邪佞当道,五毒并出。《吕氏春秋》中《仲夏记》一章规定人们在五月要禁欲、斋戒。古代以五月初五为恶日,是普遍现象。在此日插菖蒲、艾叶以驱鬼,薰苍术、白芷和喝雄黄酒以避疫。

🚀 2.献礼端午节

🌈 2.1 Python画一盘粽子

快到端午节了,用 Python 画一盘粽子送给大家,
用到的 Python 库还是大家比较熟悉的 turtle,提前祝大家端午安康了。

🚩 首先,我们画一个盘子,主要代码实现如下:

minAngle = (2 * math.pi / 360) * angle / steps
rotateAngle = rotateAngle / 360 * 2 * math.pi
penup() # 起笔
setpos(b * math.sin(rotateAngle), -b * math.cos(rotateAngle))
pendown() # 落笔
for i in range(steps):
    nextPoint = [a * math.sin((i + 1) * minAngle), -b * math.cos((i + 1) * minAngle)]
    nextPoint = [nextPoint[0] * math.cos(rotateAngle) - nextPoint[1] * math.sin(rotateAngle),
                 nextPoint[0] * math.sin(rotateAngle) + nextPoint[1] * math.cos(rotateAngle)]
    setpos(nextPoint)

❤️❤️❤️ 看一下效果:

在这里插入图片描述
🚩 接着,我们再来画粽子,主要代码实现如下:

pensize(2) # 画笔宽度
pencolor(2, 51, 12) # 画笔颜色
fillcolor(4, 77, 19) # 填充色
begin_fill()
fd(200) # 向前
circle(15, 120) #画圆弧
fd(200)
circle(15, 120)
fd(200)
circle(15, 120)
fd(200)
circle(15, 60)
fd(100)
circle(15, 90)
fd(173)
circle(1, 90)
end_fill()
penup()
fd(100)
right(60)
back(105)
a = pos()
pendown()
color(60, 67, 0)
fillcolor(85, 97, 9)
begin_fill()
fd(120)
goto(a)
penup()
back(15)
left(90)
fd(20)
right(90)
pendown()
fd(150)
right(120)
fd(24)
right(60)
fd(120)
right(60)
fd(24)
end_fill()
begin_fill()
left(110)
fd(65)
left(100)
fd(24)
left(80)
fd(50)
end_fill()

🚩 最后,我们再添加一下文字,代码实现如下:

在这里插入图片描述

🌈 2.2 html5数粽子小游戏

在这里插入图片描述

<!DOCTYPE html>
<html>
<!--
。
-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>数粽赢大礼过端午——盐龙网</title>
<script type="text/javascript">
var GID = "shuqian";
var SCORE_LIMIT = 600000;
var APP_LIST_URL = 'http://1251002861.cdn.myqcloud.com/1251002861/index.html';
</script>
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/createjs-2013.12.12.min.js"></script>
<script type="text/javascript" src="js/qipa_app.js"></script>
<script type="text/javascript" src="js/qipa_stage.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<style type="text/css">
html,body,canvas {
margin: 0px;
padding: 0px;
border:none;
text-align: center;
background-color: black;
}
canvas {
background-color: white;
}
</style>
</head>
<body>
<canvas id="stage">
您的浏览器不支持html5, 请换用支持html5的浏览器。
</canvas>
<script language=javascript>
var mebtnopenurl = 'http://www.ylw0813.com/default.html';
window.shareData = {
       "imgUrl": "http://game2.id87.com/games/sqsdscj/icon.png",
       "timeLineLink": "http://www.ylw0813.com/default.html",
       "tTitle": "数粽赢大礼过端午",
       "tContent": "数粽赢大礼过端午"
};
 
function goHome(){
window.location=mebtnopenurl;
}
function clickMore(){
if((window.location "").indexOf("zf",1)>0){
window.location = "http://www.ylw0813.com/default.html";
}
else{
goHome();
}
}
function dp_share(){
document.title ="我30秒内数了" myData.score "个粽子,手都快抽筋,你也来试试看!";
document.getElementById("share").style.display="";
window.shareData.tTitle = document.title;
}
function dp_Ranking(){
window.location=mebtnopenurl;
}
 
function showAd(){
}
function hideAd(){
}
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
    
   WeixinJSBridge.on('menu:share:appmessage', function(argv) {
       WeixinJSBridge.invoke('sendAppMessage', {
           "img_url": window.shareData.imgUrl,
           "link": window.shareData.timeLineLink,
           "desc": window.shareData.tContent,
           "title": window.shareData.tTitle
       }, onShareComplete);
   });
 
   WeixinJSBridge.on('menu:share:timeline', function(argv) {
       WeixinJSBridge.invoke('shareTimeline', {
           "img_url": window.shareData.imgUrl,
           "img_width": "640",
           "img_height": "640",
           "link": window.shareData.timeLineLink,
           "desc": window.shareData.tContent,
           "title": window.shareData.tTitle
       }, onShareComplete);
   });
}, false);
</script>
<!--<div id=share style="display: none">
<img width=100% src="http://game2.id87.com/games/sqsdscj/share.png"
style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
ontouchstart="document.getElementById('share').style.display='none';" />
</div>-->
<div style="display: none;">
<script type="text/javascript">
            var myData = { gameid: "sqsdscj" };
function dp_submitScore(score){
myData.score = score;
myData.scoreName = "数了" score "个粽子";
if(score>0){
if (confirm("我勒个去了,30秒你数了" score "个粽子!快通知一下小伙伴吧!")){
dp_share();
}
}
}
function onShareComplete(res) {
                if (localStorage.myuid && myData.score != undefined) {
                    setTimeout(function(){
                        if (confirm("要将成绩提交到数粽游戏排行榜吗?")) {
                            window.location ="http://www.ylw0813.com/default.html";
                        }
                        else {
                            document.location.href = mebtnopenurl;
                        }
                    }, 500);
                }
else {
        document.location.href = mebtnopenurl;
}
       }
</script>
<div style="display: none;">
<script type="text/javascript">var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cscript src='" _bdhmProtocol "hm.baidu.com/h.js%3F0ae524064813b8dc07ece5ce724a7b04' type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_2947366'%3E%3C/span%3E%3Cscript src='" cnzz_protocol "s5.cnzz.com/stat.php%3Fid%3D2947366' type='text/javascript'%3E%3C/script%3E"));</script>
</div>
</body>
</html>

在这里插入图片描述

评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IT邦德

客户部署资料,步骤超详细

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值