At the beginning of the game, the player will first enter (1) a minimum number (a positive integer, > 0), (2) a maximum number that is greater than the minimum and less than 1,000 (ONE THOUSAND), and (3) the number of guesses that the player can have and the number should be less than 10 (<10). The program then will generate a random number between the minimum and the maximum (include both ends). The player can guess the number for several times (depending on the above input in (3)). While guessing the number, the game will give a hint to the player -‐-‐ either the guess is too high or too low. If the player can’t guess the number correctly within the allowed number of trials, the game will show the answer and ask if the player wants to play again. If the players guess the number successfully, the game will congratulate the player and ask if the player wants to continue.
apenam7 / guessing-integer-game Goto Github PK
View Code? Open in Web Editor NEWAt the beginning of the game, the player will first enter (1) a minimum number (a positive integer, > 0), (2) a maximum number that is greater than the minimum and less than 1,000 (ONE THOUSAND), and (3) the number of guesses that the player can have and the number should be less than 10 (<10).The program then will generate a random number between the minimum and the maximum (include both ends). The player can guess the number for several times (depending on the above input in (3)). While guessing the number, the game will give a hint to the player -‐-‐ either the guess is too high or too low. If the player can’t guess the number correctly within the allowed number of trials, the game will show the answer and ask if the player wants to play again. If the players guess the number successfully, the game will congratulate the player and ask if the player wants to continue.
License: MIT License