Pair programming Jobs

Source: Internet
Author: User
Tags rounds

I. Topics and their requirements

The Golden Dot game is a digital mini-game whose game rules are:

n Classmates (n usually greater than 10), each person writes a rational number between 0~100 (excluding 0 or 100), gives the referee, the referee calculates the average of all the numbers, and then multiplies by 0.618 (the so-called Golden Section constant) to get the G value. The number of the submitted nearest to G (absolute value) of the students get n points, the farthest from the G students get-2 points, the other students get 0 points. After a few days of playing, we found some interesting phenomena, such as the golden dots moving down gradually.

Now please according to the rules of the game, make up a can play with a number of small game program, the requirements are as follows:

1, this job belongs to the pair programming project, must be completed by two people, and will be sent to the blog, respectively, the operation of the source code submitted to the codeing system;

2, if possible to use the C/s or b/n as much as possible, that is, using the server to receive and process all the players submitted by the number, and the results back to the players, players can be submitted by the client number;

3, if the use of single-machine approach, it is necessary to provide users with convenient input interface;

4, the game can run at least 10 rounds at a time, and can keep the results of the rounds.

Second, Function introduction

The program implements the input of the player's information through a for loop nesting, stores the number entered by the player with the array s, and then averages the number of digits to be calculated, Then multiply by 0.618 to get the G value, then use the function abs () to calculate the player's number and G value absolute values and then use the array S2 and S3 to achieve the current round score and the total number of storage, and then output it.

The intermediate for loop uses loop control variables I and J to control the number of rounds that are played and the number of participants in a game, and after this cycle runs, it is possible to calculate the number of players and then find the average value of G.

The absolute value is then evaluated for each player's score, which also saves each round of game performance and outputs the results of each round, as well as showing the sum of all the achievements that have been made until this turn.

Third, the operation process

For entry into the game:

For the first round of input:

For the first round of the game output:

To proceed to the next round of input:

The second round of output, at which point the total score after running two rounds and the number of points in this round can be displayed:

.........

Until the end.

Four, knot pair programming experience

Everyone in their own design, implementation of the software process, will inevitably make such a mistake. In the process of pair programming, I and my teammates have a lot of discussion, in the review and communication at any time, there will inevitably be disagreements, but we have to discuss the final choice of the most effective way to solve. Therefore, in such a pair programming, our mistakes are not as easy to make mistakes as when they were done alone, the initial quality of the program obviously improved a lot, saving a lot of later modification process.

Comprehensive to think, finally understand the teacher to set the purpose of the pair programming, the effect has been beginning.

Five, the evaluation of teammates

My team-mates numbered one of the few girls in our class who were not particularly knowledgeable. After two weeks of pairing programming to find the other side is a very serious person, in the process of pairing programming to give me a lot of help, in the mutual supervision of learning, teammates also have a new understanding.

Also in this pair of programming to recognize that a good team must be a united, good communication team, because the ability of the individual is limited, the cooperation between different people and communication can let each of us to the strengths of each other, better to play their own advantages.

Finally attached and the pictures of the teammates:

    • My coding Address: https://coding.net/u/2013040101034
    • Teammate Blog Address http://www.cnblogs.com/wanjhon/
    • Teammate's coding Home address:Https://coding.net/u/wanjhon

Pair programming Jobs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.