EE308-Lab4

知识=快乐 2021-10-09 18:15:33
The Link Your Class https://bbs.csdn.net/forums/MUEE308FZ?category=0
The Link of Requirement of This Assignmenthttps://bbs.csdn.net/topics/601188617
MU STU ID and FZU STU ID19105924 and 831901302
Teammate's MU STU ID and FZU STU ID19105495 and 831901322
The Aim of This AssignmentDevelop a BoBing software based on the prototype of Lab 3
Video demo linkhttps://www.bilibili.com/video/BV1JQ4y1X7B7?spm_id_from=333.999.0.0
 

目录

PSP Form

GitHub link 

Video demonstration

 The key or difficult functions 

Programming thinking

The big event

Photo of the Working Experience 

Summary


PSP Form

Personal Software Process StagesEstimated time(mins)Real Time(mins)
Planning120180
Estimate6060
Development6090
Analysis120130
Design Spec6060
Design Review150130
Coding Standard2020
Design450520
Coding300320
Code Review100120
Test5040
Test Report5560
Postmortem & Process Improvement Plan· 3530
Total15801760

GitHub link 

https://github.com/SYSS0115/Bobingver1/tree/main/app%E4%BF%AE%E6%94%B9%E7%89%88

Video demonstration

https://www.bilibili.com/video/BV1JQ4y1X7B7?spm_id_from=333.999.0.0

 The key or difficult functions 

 

1. As a result of the user shaking the phone, the software will generate six random dice. Their final position, the number of dice on the die, and the rotation Angle of dice are all random. Most importantly, they will be displayed on the screen in the form of animation.So, we build a function to generate the above random data, and then use the generated random data to create the animation data and set the animation effects.

2.  After the user rolls the dice, the soft armor will automatically give the result of the game. The logical conditions for judging the result of the game are very complicated, and we set many restrictions before finally realizing it.

Programming thinking

For 1: 

First determine the number of dice, that is, six, and then set the total number variable, and the number of dice for each number of the array.

Then we build a function that randomly generates the roll, final position, rotation Angle of each die, and calculates the six values in the countList (number of dice per number) and countSum (total number of dice).

Code used to generate a random roll on a dice.

The code used to generate the random final position of the dice.

Code used to generate the random Angle of rotation at the end of the die.

Next, use createAnimationData to generate an animation of the dice based on the previously generated data.

Finally, we need to avoid the problem that the dice overlap in position, so we need to construct a function to determine whether the dice overlap in position.

Code used to determine whether positions overlap:

So far the problem has been basically solved. The specific implementation effect can be seen in the video

 

For 2: 

According to the rules, we can roll a total of 13 situations.

The champion wears a golden flower

It means four dices are 4 and two dices are 1.

 

Triumph on all fronts

It means six dices are 6.

 

The land of gold

It means six dices are 1.

 

Six black spots

It means six dices are the same (not include 1 and 6).

 

Five red

It means five dices are 4.

 

Five sub-ka

It means five dices are the same (not include 4).

 

Four red

It means four dices are 4.

 

The hall of fame

It means six dices are 1,2,3,4,5,6.

 

Three red

It means three dices are 4.

 

Chin-shih

It means four dices are the same (not include 4).

 

Two red

It means two dices are 4

.

 

One red

It means one dice is 4.

 

Not winning

It means if you do not meet the above 12 conditions, you do not win the lottery. In other words, none of the dice is 4 and it is not Chin-shih, the land of gold, six black spots and five sub-ka.

 

The big event and gains.

1.  At the beginning, when we got this assignment, we didn't have any clue, and we didn't even know what tools and software to use to realize it. Later, we learned online that it was relatively easy to develop a small program using "wechat Developer "tool.However, this tool is completely unfamiliar to us, and even the JavaScript language it requires we have not learned, so one of the most troubling things for us is to become a preparatory learning work before starting. We spent a lot of time learning the operation of this software and learning the programming language.In the case of image inserts, we didn't know at first that the tool would be unfriendly to local images and would generally not recognize local image inserts.But then we learned to copy the local image to the project folder, and then use the image to load the local image as the interface background.However, there was still a bug in the actual implementation process. Once the background was inserted, the buttons previously set on the page could not be displayed. After checking the official website documents and learning other people's blogs, we solved the problem by setting z-index level in the WXSS file and placing the image label at the bottom.

    After this event, we have a preliminary understanding of the operation of the "wechat developer" tool, know the general process of developing a small program with it, also learned its basic steps for picture operation, and even a little preliminary understanding of the JavaScript language

2.    When we came up with the code for the 12 situations that the dice roll, we thought we would just write code based on their salient features as the 12 conditions. However, when we compiled the program after writing the code, we found that in these 12 cases, there might be repetition and bugs. For example, if we roll four 2 and two 4, obviously, it is Chin-shih. But, because it has two 4, it's also two red. This caused bugs to appear in the program preview.

    Hence when we write the code for two red, we put one more condition on it: the other four dices can't be the same.

   In the same way, one red requires another condition: the other five dices cannot be the same(Five red 、Five sub-ka) or four of the other five dices cannot be the same(Four red、Chin-shih) or at least two of the other five dices are identical(The hall of fame).

   From this, I've learned to be thoughtful when designing programs and to list all possible scenarios so as to eliminate unnecessary bugs.

3.  When we came up with the idea of a page jump, we thought we'd just use ‘navigateTo’ to jump.

   However, when we finished compiling the code, we found that the small program sometimes failed to jump to the page, unable to jump to the interface.

    After consulting the data, it was found that there was an interface of repeatedly returning to the jump in our program, and there was a limited number of repeated jumps (the number of repetitions detected during compilation was 4), and the interface could not be repeated after the number exceeded.

   Just using ‘redirectTo’ can avoid this problem.

      From this, We realized that writing code and implementing programs are two very different things, and that compiling with flawless code can sometimes have bugs and unexpected problems.

Photo of the Working Experience 

 

Summary

     This Lab is based on the last Lab, in order to realize the software prototype in Lab3, we have never carried out such a large workload experiment before.The understanding of the tools used and the required knowledge is to start from scratch. From the beginning of the preparation stage, we are in the process of continuous learning, learning and understanding the basic principles of software development and how to achieve the corresponding functions.In the coding stage, because we were not very proficient in the development language, the code often reported errors and even some very strange bugs. When problems appeared, we would search on the Internet and find solutions from other people's blogs.It can be said that the process of coding is very bumpy, but we also learned a lot of knowledge, now for the small program front-end code understanding has been more in-depth, some simple functions can basically achieve.

       But this experiment has many insufficient places, such as we have a software prototype can realize multiplayer online game room and have a result list, but because we don't have time to learn the related knowledge of back-end code again, there is no way for networking, can not meet the higher demand of online games,So our multiplayer mode is simply to share the results with our wechat friends for online blogging.So, we're going to continue to work hard, continue to learn JavaScript, learn how to really do networking, improve our little programs, improve our capabilities.

     In general, this experiment is very meaningful, we started to develop a small program, in this process, we continue to explore and learn, which is full and happy.Come on, there is still a lot to learn, there is really a long way to go.💪💪💪

...全文
625 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

183

社区成员

发帖
与我相关
我的任务
社区描述
福州大学 梅努斯国际工程学院 软件工程 教学
软件工程 高校
社区管理员
  • 单步调试
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧