Below is an example of the entire gameplay. Let's play the game of 'Take the Coins', 31 coin(s) in the basket. Enter the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Below is an example of the entire gameplay. Let's play the game of 'Take the Coins', 31 coin(s) in the basket. Enter the
Below is an example of the entire gameplay. Let's play the game of 'Take the Coins', 31 coin(s) in the basket. Enter the number of coins to take out: 5 Invalid input. The input must be between 1 and 3. Enter the number of coins to take out: 3 28 coin(s) in the basket. Bot took out 4 coin(s) from the basket. 26 coin(s) in the basket. Enter the number of coins to take out: 1 25 coin(s) in the basket. Bot took out 2 coin(s) from the basket. 23 coin(s) in the basket. Enter the number of coins to take out: 3 20 coin(s) in the basket. Bot took out 6 coin(s) from the basket. 14 coin(s) in the basket. It is EVEN number. You won the game! Shown in boldface red are example user inputs.
I Use at least two functions when writing the program: (1) a function that returns a random integer number between two integer numbers; and (2) a function that prompts the user until a valid integer input is obtained and returns that input. Choose the name, input parameters, and return type of the two functions appropriately. Note . . . Use meaningful variable and function names. • Optimize your code for efficiency and easy reading. Remember to style your code properly Modularize your program Make sure to seed random number generator with the computer clock. . END