本文主要是介绍中山大学软件工程中级实训Part3_DesignReport,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
github地址:https://github.com/linjiafengyang/GridWorld
欢迎访问我的个人博客:Talk is cheap. Show me the code!。我相信会有所收获的。
DesignReport
1.Inception: clarify the details of the problem:
- a. What will a jumper do if the location in front of it is empty, but the location two cells in front contains a flower or a rock?
Answer:
The jumper will move one step to the empty cell in front of it and then jump over a flower or a rock when the jumper goes on moving. - b. What will a jumper do if the location two cells in front of the jumper is out of the grid?
Answer:
The jumper will only move one step in front of it and then turn 90 degrees to right to avoid letting itself out of the grid. - c. What will a jumper do if it is facing an edge of the grid?
Answer:
The jumper will turn 90 degrees to right to avoid letting itself out of the grid when facing an edge of the grid. - d. What will a jumper do if another actor (not a flower or a rock) is in the cell that is two cells in front of the jumper?
Answer:
In my design, I let the one jumper which is in front of the other one go first.
It moves two cells at first and then the other one moves to the location of the privious one. - e. What will a jumper do if it encounters another jumper in its path?
Answer:
In my design:
If the two jumpers is two cells away each other, I let one of them moves one cell just like the other one is considered as a rock or a flower.
And then, I let the other one jumps over the privious one. That is to say, the other one moves itself to the location of the privious one.
If the two jumpers is adjacent with each other, they can move two cells to jump over each other regularly. - f. Are there any other tests the jumper needs to make?
Answer:
What will a jumper do if the two cells in front of it are both a flower or a rock or a jumper?
In my design, it can turn 45 degrees and move two cells if there is empty.
Etc…
这篇关于中山大学软件工程中级实训Part3_DesignReport的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!