183
社区成员
发帖
与我相关
我的任务
分享 Although we only completed the local version, we strictly reproduced the rules of the traditional Xiamen Bo Bing. We use a mobile phone or an iPad to enjoy the happiness of Bo Bing on the table, experience the rich emotions brought by Bo Bing, and finally record the size of the cake obtained by each player. You can distribute the prepared prizes in advance. This is much more interesting than a simple Bo Bing!!!!!
And 10 local Bo Bing chances can be used to measure “European gas” ~, which is necessary to buy lottery tickets!!
| The Link Your Class | https://bbs.csdn.net/forums/MUEE308FZ?category=0 |
|---|---|
| The Link of Requirement of This Assignment | https://bbs.csdn.net/topics/601188617 |
| MU STU ID and FZU STU ID | 19105185_831901317 |
| Teammate's MU STU ID and FZU STU ID | 19105169_831901316 |
| Teammate's blog link | https://bbs.csdn.net/topics/601428066 |
| GitHub link | https://github.com/1615639948/lab4 |
| Video demo link | 福大作业博饼小程序_哔哩哔哩bilibili https://www.bilibili.com/video/BV1GL4y167bb/ |
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(){}中写这段代码,使得载入本页面
/*
博饼结果大小的判断语句
设置一个名为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("谢谢参与")
}
//每次按下摇骰子按钮就会唤起这个函数
/*
这个函数时我们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,
})
},


1. In dealing with version management:
we have communicated some brief shorthand signs in advance, which has greatly improved the speed of programming. After updating the code, you'd better add detailed comments to facilitate your peers to keep up with your ideas, otherwise it will bring a very large learning cost to each other, and the structure of the code will gradually move in the direction in which you two are uncertain.
You can assign some modules before writing the code, and provide some interfaces for these modules. The two people write modules with high similarity to improve efficiency. Finally, the two people jointly synthesize the modules into main functions. It is best to spare some time to introduce each other's code ideas, which can achieve twice the result with half the effort.
2. In learning new knowledge:
when communicating, it's best to spare some time to explain new knowledge to their peers. The two people need to constantly improve their ability of expression and teaching, which can improve the speed of coding and learning new knowledge, and avoid repeated learning.
Before using GitHub, due to the path dependence, we tried to use the version manager provided by wechat. It may be due to our limited ability and our shallow understanding of GIT instructions, which made it difficult for us to manage the version. After an hour of research, we switched back to using GitHub, and sure enough, everything ran naturally.

From the beginning of searching materials, we have always been in the state of learning while doing. The blog written by "big man" often has many terms and hides a lot of details, so it wastes most of our learning time.
In this process, I deeply realize the importance of "hidden rules" after domain segmentation - if you don't understand the industry conventions, you will often make some very low-level mistakes, but it is inevitable for beginners.
Many blogs copy each other and follow the same pattern after fuzzy search.
In order to understand the blog written by the boss, I spent a lot of time browsing relevant or irrelevant materials and gradually summed up how to blur the knowledge needed for search. This process is very difficult. But it has summed up some vague experience in learning new things.
Some commonalities of embedded programming are explored: page loading, monitoring and control events in wechat applet programming are packaged in one method, which is similar to configuring watchdog and interrupt in embedded programming
The logic of various controls, the transfer of pages, the level of maps and controls, the attributes of various labels, the APIs and various methods provided by wechat
This process took us about 15 hours. Although the time for purely obtaining information accounted for only about 5 hours, the process of practice and attempt took the remaining 10 hours. It is the process of practice and trial and error that turns the learned knowledge into ability.
How to generate random numbers
Where to store after generation
How to call after saving
How does it correspond to the same map
How to make the map appear in the same position
How to judge the 博饼大小 by six random numbers
How to record the information of each Bo cake
How to push information to players
How to test the main function of Bo Boing
We discussed with each other and repeated coding. After solving each problem, we reviewed and reflected, and found that the code is very lengthy. However, since this process is promoted while learning, it is impossible to reconstruct the logic of this function implementation in time. From this point of view, we have deeply realized how important the framework of software engineering is. The continuous delay in the preparation of software should also be due to the continuous emergence of code and bugs in the development process and with the advancement of testing.
| week | New code (line) | Cumulative code (line) | Learning time this week (hours) | Cumulative learning time (hours) | Important growth |
|---|---|---|---|---|---|
| week 6 | 4000 | 4000 | 30 | 30 | Preliminarily mastered JS programming, web page design, and deeply experienced pair programming |
| Personal Software Process Stages | Estimated Time/minutes | Completed Time/minutes |
|---|---|---|
| Planning | 30 | 30 |
| Estimate | 20 | 20 |
| Development | 60 | 60 |
| Analysis | 20 | 20 |
| Design Spec | 30 | 30 |
| Design Review | 50 | 50 |
| Coding Standard | 30 | 30 |
| Design | 60 | 60 |
| Coding | 500 | 1000 |
| Code Review Planning | 1000 | 1000 |
| Test | 100 | 500 |
| Reporting | 120 | 240 |
| Test Report | - | - |
| Size Measurement | 10 | 10 |
| Postmortem&Process Improvement | 20 | 20 |
| total | 2050 | 3070 |

Through this experiment, I learned that if I want to develop a 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 cooperation with partners can make things easier to complete. We only reduce the lab3 prototype image. Due to the relationship between image size and resolution, we can't reduce it 100%. In order to be beautiful and smooth, we have to compromise some images and functions. Due to the limitations of time and ability in the experiment, I hope I can further explore these abilities in the next study.