Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Dungyichao authored Jan 26, 2019
1 parent 9add61c commit f94479b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ We don't expect the chosen one for the next play to be the true answer, our goal
6. We use the function **```givenum```** to generate a sequence of code which need to be guessed by our program.<br />
<p align="center"><img src="/image/5.JPG"></p>

7. This is the main program. First, use the function **```ini_population```** to initialize the code set which store all the possible answer. Second, we use randomly guess. We then receive the A and B value when we use the guess to play against the real answer. This play will be counted in the number of play. We store the number of play in the variable "play_count". We will add up the "play_count" by one whenever we guess a value and play against the real answer (which also occurs in the while loop). The while loop will terminate until we obtain the correct answer where A=4 and B=0. <br />

The for loop in the while loop is to check whether we keep or remove the element from the code set. The element to be removed is the one which can not give us the same value of A and B based on our guess. After cleaning the code set, we pick up one element from the code set to act as the next guess. The picking method has already elaborated in the previous section. This guess will play against the true answer and receive A and B value. The while loop will end when we get the guess with A=4. Lastly, the program output the number of time we play to get the true answer.
7. This is the main program. First, use the function **```ini_population```** to initialize the code set which store all the possible answer. Second, we use randomly guess. We then receive the A and B value when we use the guess to play against the real answer. This play will be counted in the number of play. We store the number of play in the variable "play_count". We will add up the "play_count" by one whenever we guess a value and play against the real answer (which also occurs in the while loop). The while loop will terminate until we obtain the correct answer where A=4 and B=0. <br />The for loop in the while loop is to check whether we keep or remove the element from the code set. The element to be removed is the one which can not give us the same value of A and B based on our guess. After cleaning the code set, we pick up one element from the code set to act as the next guess. The picking method has already elaborated in the previous section. This guess will play against the true answer and receive A and B value. The while loop will end when we get the guess with A=4. Lastly, the program output the number of time we play to get the true answer. <br />
<p align="center"><img src="/image/main_final.JPG"></p>

## 4. Result
Expand Down

0 comments on commit f94479b

Please sign in to comment.