EE308FZ LAB2-2
目录
- 1. PSP TABLE
- 2. LEARNING PROGRESS BAR
- 3. Programming Thinking & Key Functions
- 3.1 PROGRAMMING THINKING
- 3.2 KEY FUNCTIONS
- 4. IMPORTANT EVENTS
- 5.The Pair Programming Experience
- 6. FINAL RESULTS
- SUMMARY
1. PSP TABLE
| · Estimate | · 估计这个任务需要多少时间 | ||
| · Analysis | · 需求分析 (包括学习新技术) | ||
| · Design Spec | · 生成设计文档 | ||
| · Design Review | · 设计复审 (和同事审核设计文档) | ||
| · Coding Standard | · 代码规范 (为目前的开发制定合适的规范) | ||
| · Design | · 具体设计 | ||
| · Coding | · 具体编码 | ||
| · Code Review | · 代码复审 | ||
| · Test | · 测试(自我测试,修改代码,提交修改) | ||
| · Test Report | · 测试报告 | ||
| · Size Measurement | · 计算工作量 | ||
| · Postmortem & Process Improvement Plan | · 事后总结, 并提出过程改进计划 | ||
2. LEARNING PROGRESS BAR
(line) | this Day(hours) | ||||
|---|---|---|---|---|---|
3. Programming Thinking & Key Functions
3.1 PROGRAMMING THINKING
As this was the first time we had set out to create a fully functional piece of software, we first consulted a very large amount of information on the subject and it was difficult for us to implement a complete front and back-end piece of software in a week with no basic knowledge. Understanding that the WeChat applet development framework was relatively easy to get started with, we decided to use WeChat applets as the vehicle for this development.
First of all, we started to follow the teaching videos on the learning website to learn the use of wechat development tools and the code specifications and grammar styles of different files, and gradually completed the front-end page through continuous experiments and exploration
Then, for the backend database interface and data store construction, we used open source templates in POSCMS. To be honest, due to time constraints, we were unable to master the backend development and could only implement some basic functions. We will continue to refine and improve these features over time.
In the process of improving the basic functionality, we encountered the following difficulties:
Adaptation of page button positions, button function jumping;
The basic rules of Bobing, sorting out the code logic of Bobing results;
Recording of Bobing results.
3.2 KEY FUNCTIONS
Because the final result of Bobing will generate a lot of awards, which leads to the complexity of Bobing's rules and the confusion of coding logic. In the process of sorting out the logic rules step by step, we will continue to modify, experiment and modify. We will show some code here.
/*
基于六个骰子点数的博饼结果的判断语句
设置一个名为strarr的字符串数组,并直接用push的方法推入结果,可以实现多次博饼
*/
if (four === 1 && one + two + three + four + five + six != 21 && one < 4 && two < 4 && three < 4 && five < 4 && six < 4) {
this.data.strarr.push("一秀")
}
if (four === 2 && one < 4 && two < 4 && three < 4 && five < 4 && six < 4) {
this.data.strarr.push("二举")
}
if (four === 3) {
this.data.strarr.push("三红")
}
if (two === 4 || three === 4 || one === 4 || five === 4 || six === 4) {
this.data.strarr.push("四进")
}
if (one == 1 && two == 2 && three == 1 && four == 2 && five == 1 && six == 2) {
this.data.strarr.push("对堂")
}
if (four === 4 && one !== 2) {
this.data.strarr.push("状元")
}
if (five == 5 || three == 5 || two == 5 || one == 5 || six == 5) {
this.data.strarr.push("五子登科")
}
if (four == 5) {
this.data.strarr.push("五红")
}
if (six == 6 || five == 6 || three == 6 || two == 6) {
this.data.strarr.push("六杯黑")
}
if (one == 6) {
this.data.strarr.push("遍地锦")
}
if (four == 6) {
this.data.strarr.push("六杯红")
}
if (four == 4 && one == 2) {
this.data.strarr.push("金花")
}
if (four == 0 && one < 4 && two < 4 && four < 4 && five < 4 && six < 4 && three < 4) {
this.data.strarr.push("谢谢参与")
}
onLoad: function (options) {
var
a = Math.floor(Math.random() * 6) + 1,
b = Math.floor(Math.random() * 6) + 1,
c = Math.floor(Math.random() * 6) + 1,
d = Math.floor(Math.random() * 6) + 1,
e = Math.floor(Math.random() * 6) + 1,
f = Math.floor(Math.random() * 6) + 1;
}// 使用简单的自带函数即可,注意应该在onLoad(){}中写这段代码,使得载入本页面
On the basis of equation 1, we can achieve single person multiple times of pancakes and carry out results statistics and awards.
However, if we want to achieve multi person and multi time forum,we need additional functions to count the forum results and issue rewards. This is not easy for us."random1" is used to realize this complex function.
//每次按下摇骰子按钮就会唤起这个函数
/*
这个函数时我们js逻辑层的主函数,其中通过调用我们自己编写的函数来实现传统的博饼游戏对局
*/
reload() {
//重新摇色子
this.random()
var bobing = this.Def_bobing();//计算博饼大小的函数,逻辑和function一样
this.judge(this.data.Gamernum, bobing)//这个函数用来判断
this.countbing(bobing)//传统博饼中有奖池,这个函数计算奖池中剩余的奖项
//终结逻辑
if (this.sumbing() != 0) {
// 玩家更替的逻辑
if (this.data.Gamernum < this.data.Gamernumc) {
var temp = this.data.Gamernum + 1
this.setData({
Gamernum: temp,
})
} else {
this.setData({
Gamernum : 1
})
}
} else {//将得到的结果储存在本地gamerarr系列的数组
this.data.score1 = this.bingNum(this.data.gamerarr1)//利用bingNum()统计每个人收获的饼
this.data.score2 = this.bingNum(this.data.gamerarr2)
this.data.score3 = this.bingNum(this.data.gamerarr3)
this.data.score4 = this.bingNum(this.data.gamerarr4)
this.data.score5 = this.bingNum(this.data.gamerarr5)
this.data.score6 = this.bingNum(this.data.gamerarr6)
this.setData({
score1 : this.bingNum(this.data.gamerarr1),
score2 : this.bingNum(this.data.gamerarr2),
score3 : this.bingNum(this.data.gamerarr3),
score4 : this.bingNum(this.data.gamerarr4),
score5 : this.bingNum(this.data.gamerarr5),
score6 : this.bingNum(this.data.gamerarr6),
recode: false
})
}
},
to_index(){
wx.navigateTo({
url: '../index/index',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
Gamernumc: app.globalData.People,
})
},
4. IMPORTANT EVENTS
How to make dice dynamic
This was another difficult point of coding and makes we debated for some time. To animate the dice, we initially opted to use gifs, but after some practical work, we found that if we used gifs, the number of dice in the end could not be determined. So we opted to make the static image move to achieve this. This was much more difficult than using a direct motion picture, so it also took us a long time to code.Writing key parts of the code
The most critical part of the Bobing mini program is to determine the player's winning result based on the number of dice. In this part, we need to determine the number of dice, of which there are six, and by the total number of dice, which adds another layer of difficulty to our coding. This part of the code is the most logical and complex part. Although it's difficult, we finished it. When this part of the code is complete, there are many gains for us.
Understanding of view layer and learning JS language to finish UI interface
The previous week, we handled the UI page.Our page design is beautiful enough, but it is also very complex. Therefore, this week it affects our page coding accordingly, bringing us some difficulties.
In order to complete the UI page we designed, we need to have a good understanding of view layers, and we need to be more proficient in the JS language. For this reason, we have been striving to improve our logic understanding, view understanding, and JS language programming capabilities since the beginning of the experiment; We have paid a lot of effort and effort, and similarly, we have gained a lot.
5.The Pair Programming Experience
We have not done pair programming for the first two weeks and after the last week we have had some experience of pair programming. This week's programming assignment was even more ambitious and complex than last week's, giving us a special experience, and we were also able to better distribute the parts that needed to be done separately and those that needed to be done together. We were also able to respect each other's ideas better in the face of arguments and not let them take up a lot of time, and we were able to control and plan our work better, making it easier for us to complete our programming assignments and to improve the completion of them.

6. FINAL RESULTS
The url for this work on GitHub:
The video for this assignment shows the link:

SUMMARY
Through this experiment, I learned that if you want to develop a piece of software, from the initial concept to the main design, from the logical implementation of the function to the construction of the code, plus the final testing and performance optimization, each step will take a lot of time. Communication and collaboration with partners can make things easier to get done. In this experiment, we achieved all the functions expected in the prototype design, but in order to be beautiful and smooth, we had to compromise: give up some image and functional perfection. In addition, due to the limitation of time and ability in the experiment, we have not further improved some functions and there are shortcomings. I hope to further explore and improve these abilities in the following research. At the same time, we hope that in the future, we can develop more interesting and more complete mini-program.
相关推荐
JEP30-PX100A PartModel Product Guidelines for Electronic-Device Substrates and Assemblies – XML Requ
JEP30-PX100A PartModel Product Guidelines for Electronic-Device Substrates and Assemblies – XML Requirements
基于Matlab的自动睡眠粒状结构检测算法,从脑电信号中进行。.zip
1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
JEP375 2.5D_3D Silicon thinned wafers with Through Silicon Vias (TSV’s) and Backside Redistribution
JEP375 2.5D_3D Silicon thinned wafers with Through Silicon Vias (TSV’s) and Backside Redistribution Layer (RDL).pdf
考虑供电可靠性与算力柔性的数据中心园区源‑储‑荷一体化规划研究(Matlab代码实现)
考虑供电可靠性与算力柔性的数据中心园区源‑储‑荷一体化规划研究(Matlab代码实现)内容概要:本文围绕“考虑供电可靠性与算力柔性的数据中心园区源-储-荷一体化规划”展开研究,提出了一种综合能源系统优化规划方法。该方法充分考虑数据中心对供电可靠性的高要求以及算力负载的灵活性特征,将电力供应、储能配置与计算负荷进行协同优化。通过建立数学模型,整合光伏发电、储能系统与数据中心负荷调度,利用Matlab代码实现优化求解,旨在提升能源利用效率、降低运营成本并增强系统韧性。研究涵盖了对新能源出力不确定性、负荷波动以及储能动态行为的建模与仿真分析,最终验证了所提一体化规划方案在提高供电可靠性和实现算力资源柔性调度方面的有效性。; 适合人群:具备一定电气工程、能源系统或计算机科学背景,从事数据中心、智能电网、综合能源系统等相关领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:① 为数据中心园区的绿色低碳与高可靠运行提供规划设计方案;② 实现可再生能源的高效消纳与储能系统的优化配置;③ 探索算力作为柔性负荷参与电力系统互动的潜力,支撑新型电力系统建设。; 阅读建议:此资源以Matlab代码为核心,辅以理论模型,建议读者在理解基本原理的基础上,动手运行和调试所提供的代码,通过修改参数和场景设置来深入掌握一体化规划的优化逻辑与关键技术细节。
歌曲爆款传播预测数据集10000首曲目Spotify音频特征机器学习
本数据集为合成音乐数据,包含2010至2025年间10000首曲目的Spotify风格音频特征与明确的爆款(viral)目标标签。现有音乐数据集常缺少可用建模目标或存在授权限制,本数据集提供了干净、字段完整、可直接用于监督学习的基准语料。字段涵盖节奏、能量、可舞性、声学度、效价等音频属性,以及曲目元数据与年份信息,目标列viral基于传播表现定义,可直接用于二分类建模。适合开展爆款歌曲预测、音频特征与传播关系分析、年代音乐风格演变可视化、特征重要性排序等分析任务,也可作为分类、回归与特征工程教学的演示数据。数据结构清晰、无缺失值,适合数据科学课程、音乐媒体分析与推荐算法原型验证使用。


