The second experiment --- Pair Programming

First, the goal of the experiment:

1) experience and they work in agile development.

2) personal programming skills and practices to further improve.

Second, the experimental content:

1) According to the following description of the problem, exercise pair programming (pair programming) Practice;

2) require students to work in pairs, free combination. Each group uses a computer, two common encoding complete experimental requirements.

3) requires pair during programming, both the switching roles at least 4;

4) programming language is not limited to, the version is not limited. Recommended to use Python or JAVA programming.

Third, the description of the problem

**生命游戏**

生命游戏是英国数学家约翰·何顿·康威在 1970 年发明的细胞自动机,它包括一个二维矩形世界,这个世界中的每个方格居住着一个活着的或死亡的细胞。一个细胞在下一个时刻生死取决于相邻八个方格中活着的或死了的细胞的数量。如果相邻方格活着的细胞数量过多,这个细胞会因为资源匮乏而在下一个时刻死去;相反,如果周围活细胞过少,这个细胞会因太孤单而死去。

游戏在一个类似于围棋棋盘一样的,可以无限延伸的二维方格网中进行。例如,设想每个方格中都可放置一个生命细胞,生命细胞只有两种状态:“生”或“死”。图中,用黑色的方格表示该细胞为“死”, 其它颜色表示该细胞为“生” 。

游戏开始时, 每个细胞可以随机地(或给定地)被设定为“生”或“死”之一的某个状态, 然后,再根据如下生存定律计算下一代每个细胞的状态:

每个细胞的状态由该细胞及周围 8 个细胞上一次的状态所决定;

如果一个细胞周围有 3 个细胞为生,则该细胞为生,即该细胞若原先为死则转为生,若原先为生则保持不变;

如果一个细胞周围有 2 个细胞为生,则该细胞的生死状态保持不变;

在其它情况下,该细胞为死,即该细胞若原先为生则转为死,若原先为死则保持不变。

Fourth, the initial vision and twinning

1. agile development and pair programming

Agile development to user needs evolve as the core, iterative, gradual approach for software development. Agile development software project in the initial construct is cut into a plurality of sub-projects, each sub-project deliverables are tested, with visual, and can be run using the integrated features. In other words, the project is divided into a large number of mutually contact, but can also be run independently of small projects and were completed in the course of this software has been in a usable condition.
Pair programming technique is a very simple concept and intuitive, you can work to achieve a multiplier effect. However, cooperation between people is not an easy task - especially when people are already accustomed to working alone time. Implementation knot benefit of the development of software programming technology will project, but these benefits must be careful thinking and planning can truly reflected. On the other hand, two experienced people may find that pair programming skills in transferring what not, but let them solve the same problem at different levels of abstraction make them faster to find a solution, and with fewer errors.
2. Pair circumstances
goal: Game of Life
Storage: https://www.github.com/localhost999/shengmingyouxi
crew blog:
Shen Ao Fan: https://www.cnblogs.com/egoista/
Zhao Linhai: HTTPS: // the WWW. cnblogs.com/zlh13437/
3. discussion topics
1) code specifications.
written in the language used is Java: annotations specification, file name specification, claim rules, and programming rules.
2) the early conclusion
Game of Life in cells according to the circumstances surrounding the change of life and death, and store it in a two-dimensional array of dot, it has two states of life and death, so the dot is set to a boolean array. To random initialization random library. For a better experience, we went a bit deeper swing programming interface to learn. For a discussion of the core algorithm, based on the design will be finished, more in-depth discussion.
3) Design Ideas

graph LR A [game_of_life] -> B (start) A -> C (stop) A -> D (continue) B -> E (random initialization state dot cell false / true) E -> F ( based algorithm updates state) E -> H (step number step to the recording cells xibao) C -> J (breaking thread of control) D -> J (breaking thread of control)

V. pair stage

graph TD X [Game_Life] -> AX [Game_Life] -> BX [Game_Life] -> CX [Game_Life] -> DX [Game_Life] -> EA [xibaozt class] -> a (cell death and initialization) B [window type] -> b (interface design) C [suanfa class] -> c (cell update) D [main class] -> d (main class) E [show class] -> e (display screen cell death)

The twinning QQ through a rough discussion, with the general conclusion on the level of the project, beginning in interface design and xibaozt design, can be relatively easy to complete, for the window class, according to team members and I swing the online tutorial and templates designed based interface with three response function start, continue, stop. Algorithmically, through our discussion, in order to clear, the state of the cell death is recorded in two-dimensional array state_one, and then through two cycles, for determining the state of the interface corresponding to the hue of black and white cells (class implementation Show ), with a count counted, thereby completing the update. Finally, to complete the call in the main class.







VI. The results are reported

VII. Experimental Summary

The experiment, because of the special circumstances, can only be simple, but let me have a deeper understanding of the logic and collaborative agile development, although twinning we need more discussion on a project, sometimes contradictions have the code, but should help standardize the implementation of the code. Meanwhile at home, because our time is fixed, so the code is very slow progress, but the result was satisfactory. The selection of the more familiar java language, but the real time of writing, some places still need access to information, sets of templates, does not seem to have been written, or soon rusty.

Guess you like

Origin www.cnblogs.com/egoista/p/12631932.html