您的位置:首页 > 其它

中山大学软件工程中级实训Part3_DesignReport

2017-03-26 21:01 253 查看

欢迎访问我的个人博客: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…
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: