Curriculum design of the second experiment summary

A. Crossword

II. First put a number in memory and then guess

Three .

 ( 1 ) first predetermined number of times can be good guess, guess again give the number range

 ( 2 ) guess is given by

 ( 3 ) If the guess is larger than the number of memory, large displays guess, on the contrary, like

 ( 4 ) If the number of runs out, then you have no chance to display

 ( 5 ) did not guess a number of interface returns the beginning when you run out of opportunities so far

FiveHttps://gitee.com/tangbin0706/mr_tang_bins_treasure/blob/master/guessgame.cpp

Six .

How to control the number of times to guess?

Frequency range is set at the beginning of the show, if not guessed, is a time to add

If (++ times> = GUESS_TIME) , it shows that you have no chance, here times before use + +

I think there can also be used for statement instead while statement

This simple guessing game may seem simple, but the foundation is not solid, I though difficult to understand, his arithmetic, his program structure, this is my learning points.

 

Guess you like

Origin www.cnblogs.com/tb-0706/p/10955202.html