EE308 lab4
| The Link Your Class | https://bbs.csdn.net/forums/MUEE308FZ?category=0&typeId=17692 |
| The Link of Requirement of This Assignment | https://bbs.csdn.net/topics/601188617 |
| The Aim of This Assignment | Develop a BoBing software |
| MU STU ID and FZU STU ID | 19103328 - 831902203 |
| Teammate's MU STU ID and FZU STU ID | 19105886 - 831902204 |
| Teammate's blog link | https://bbs.csdn.net/topics/601397122 |
| GitHub link | https://github.com/zyq-zzy/lab4 |
| Video demo link | https://www.bilibili.com/video/BV1jq4y1d7GL/ |
Directory
5.Difficult functions and programming thinking:
6.Pair programming experience.
2.PSP From
| PSP Stages | Estimated Time/minutes | Completed Time/minutes |
| Planning | 60 | 60 |
| Time Estimation | 40 | 40 |
| Development | - | - |
| Requirement Analysis | 100 | 100 |
| Design Documents | - | - |
| Design Review | - | - |
| Code Specification | 100 | 100 |
| Specific Design | 400 | 400 |
| Specific Coding | 1500 | 2000 |
| Code Review | 120 | 120 |
| Test | 600 | 800 |
| Presentation | 60 | 60 |
| Test Report | - | - |
| Calculation Workload | 20 | 20 |
| Summary&Improvement | 60 | 90 |
| Total | 3000 | 4200 |
3.learning progress bar
| N day | New code (line) | Cumulative code (line) | Learning time this week (hours) | Total Learning Time (hours) | Important growth |
|---|---|---|---|---|---|
| 1 | 100 | 100 | 5 | 5 | Familiar with js, HTML, CSS |
| 2 | 100 | 200 | 5 | 10 | Familiar the js, HTML, CSS |
| 3 | 100 | 300 | 5 | 15 | Familiar the js, HTML, CSS |
| 4 | 100 | 400 | 5 | 20 | master the js, HTML, CSS |
Github address:
https://github.com/zyq-zzy/lab4

video address:
https://www.bilibili.com/video/BV1jq4y1d7GL/
4.Assumption description
We have done the UI design in lab3. Through the last experiment we quickly determined the design direction of this software.We decided to use wechat mini program to complete this task. Because wechat small program is more convenient and fast and users do not need to download can be achieved.

This programming task is very difficult for us. In the UI model originally designed, we hoped to realize the practice of room sorting and room ID function in online mode, and to give each user a user number. But after a lot of struggle and effort we could only achieve the simplest online effect. I think this is caused by our lack of self-learning ability, and the ability to read documents needs to be improved. In future assignments, we should pay more attention to the cultivation of self-learning and consulting ability, especially those very useful English documents
5.Difficult functions and programming thinking:
In this experimental assignment, we believe that the main function and programming thinking is the judgment of the final result of six random dicers. Due to many situations and considering the priority and weight of the results, this part of the code is very error prone.
First, our thinking direction is to use a simple if else structure to solve the judgment of the result, and after creating six random numbers, we first save them into the array. The position of the array represents the value of the random number, and the number of the value is stored in the array. In this way, we can save a lot of things in judgment. After the array is created, we list the judgment basis and priority of each situation. The highest priority, that is, the higher level, is placed in front of the if else judgment. Here is our code.
<wxs module="m1">
var award = function(q,w,e,r,t,y) {
var list=[];
list.push(q,w,e,r,t,y);
var count=[0,0,0,0,0,0];
for(var i=0;i<6;i++){
count[list[i]]=count[list[i]]+1;
}
if(count[4]==4&&count[1]==2){
return "状元(金花)";
}
else if(count[4]==6){
return "状元(六杯红)";
}
else if(count[1]==6){
return "状元(遍地锦)";
}
else if(count[2]==6||count[3]==6||count[5]==6||count[6]==6){
return "状元(六杯黑)";
}
else if(count[4]==5){
return "状元(五红)";
}
else if(count[1]==5||count[2]==5||count[3]==5||count[5]==5||count[6]==5){
return "状元(五子登科)";
}
else if(count[4]==4){
return "状元(四点红)";
}
else if(count[1]==1&&count[2]==1&&count[3]==1&&count[4]==1&&count[5]==1&&count[6]==1){
return "榜眼(对堂)";
}
else if(count[4]==3){
return "探花(三红)";
}
else if(count[1]==4||count[2]==4||count[3]==4||count[5]==4||count[6]==4){
return "进士(四进)";
}
else if(count[4]==2){
return "举人(二举)";
}
else if(count[4]==1){
return"秀才(一秀)";
}
else{
return"谢谢参与";
}
}
module.exports.award = award;
</wxs>
2.Secondly, there is the problem of online back-end construction. Because we have not contacted the back-end and rarely understand the interface, we have no idea at the beginning. However, after constantly searching CSDN and other major websites, we think it is possible to use websocket to realize this function. After the decision, we began to look for relevant videos on various video websites, and we realized some functions of networking in continuous imitation and testing.
First, in order to build the backend, we installed some dependent instructions as follows
npm nodemon -D
npm i ws -s
npm i express -s
After installing the dependencies and testing them for normal use, we built the following backend. It also realizes the monitoring of the link with the back end, receives and sends back the message, and realizes the broadcast of the message after consulting the document, so that the message can be sent to all users
let express=require("express")
let websocket=require("ws")
let app=express()
let wss=new websocket.Server({port : 3001})
let count=0
wss.on('connection', (ws)=> {
count++
ws.on('message', (message)=>{
//Converts the incoming message to a string, ensuring that the data type passed to the user is normal
let data=Buffer.from(message).toString()
let s=count.toString()
data="?号玩家获得了"+data
//The message is broadcast to all users
wss.clients.forEach((client)=>{
client.send(data)
})
data=''
})
})
//Listening port 3000
app.listen(3000, () => {
console.log("启动")
})
6.Pair programming experience.
Because two people's code ability is not the same, it brought no small difficulty to group programming, in the process of division of labor and cooperation, we met many difficulties, but when we finished, it improved my communication ability and cooperation ability with my teammates, so that the division of labor and cooperation between us more clear. When we meet with difficulties, we can solve them together, when we meet with problems, we can look up information together instead of finishing our own work as before.
The job also improved my ability to write code. I learned how to use wechat development tools to write small programs and gained some insight into it.
7.The 3 events
1.One of the things that happened to us was that we didn't have a code specification, which was the easiest thing to overlook, which made the code look ugly when we first worked together, and it was not easy to understand each other's code, which caused a lot of trouble for us. With this experience we also learned that we need to determine the specifications first.
2.After designing the UI, our direction was about the mobile software, but we soon faced the task of which platform should be used to complete such a task. For example # : Unity/Visual Studio, Java: ideahtml, js: vscode/webstorm/ wechat developer tools (do small programs)c++: qt. This has brought us a lot of troubles. After online learning and hints from teaching assistants, we decided to use wechat mini program to complete the design.
3.This difficulty was encountered in the implementation process of small program, because in the process of suddenly wanted to add multiplayer online function, resulting in a series of bugs, and even some functions were affected, so we had to abandon this version. We have also learned that we should not do some unplanned tasks that will affect the original schedule.

相关推荐
EE-308 LAB4 final version.7z
这是本次实验的压缩包
EE308-Lab8-AlphaSprint-Day4
EE308-Lab8-AlphaSprint-Day4Feedback From Members1. Beichen, ZhouModulePersonal SummaryCode & Results2. Yuwei, JiangModulePersonal SummaryCode & Results3. Yifan, ZhuModulePersonal Summary4. Yifan, ShenModulePersonal SummaryCode & Results5. Shenk
工业互联网工控安全与工业质检AI大模型建设方案.pptx
工业互联网工控安全与工业质检AI大模型建设方案.pptx
2024 《计算机网络》实验教学指导书.doc
2024 《计算机网络》实验教学指导书.doc
不平衡电网下自抗扰顺序模型预测PWM整流器控制仿真模型(Simulink仿真实现)
内容概要:本文围绕面向城市空中交通的多无人机路径规划问题展开研究,提出了一套融合全局规划、动态避障与局部协同调整的综合路径规划方法。研究内容涵盖基于改进RRT算法与图论的全局路径规划、基于动态风险场和动态窗口法(DWA)的模型预测控制实现动态避障,以及基于分布式协同控制的多无人机局部路径协同策略。通过Matlab平台构建仿真环境,在多种典型城市交通场景下对所提方法进行了系统性验证,结果表明该方法在路径安全性、编队稳定性与任务效率方面表现优异。文章还深入探讨了算法的创新点与未来研究方向,为复杂城市环境下多无人机系统的自主协同提供了理论支撑与技术路径。; 适合人群:具备自动化、控制理论、计算机科学或相关领域基础知识,从事无人机系统、智能交通、路径规划、多智能体协同控制等方向研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①为城市空中交通系统中的多无人机安全、高效飞行提供可靠的路径规划解决方案;②支持在复杂、动态的城市场景中开展无人机自主导航、编队飞行与协同控制的技术研究与仿真验证。; 阅读建议:建议结合提供的Matlab代码进行实践操作,重点关注算法的具体实现细节、参数配置对性能的影响以及不同仿真场景下的实验设计,以深入理解各模块的集成逻辑与实际应用效果。



