Question: For this lab assignment, you will be writing a simple number guessing game which interacts with the user through the serial console. This will give

 For this lab assignment, you will be writing a simple number
guessing game which interacts with the user through the serial console. This

For this lab assignment, you will be writing a simple number guessing game which interacts with the user through the serial console. This will give you some hands-on experience with using the serial port and terminal emulators for console 1/0, as well as the C standard math and I/O functions from the and libraries. as a starting point for your number guessing game. You are free to implement the logic of the game and the interaction with the user in any way you choose, as long as it satisfies the requirements outlined above. Just remember that any local variables or other objects must be declared at the start of the main() function, before the call to sys_init() or any other program statements. To choose the random secret number, use the srand() function to see the random number generator, and then use rand() to generate a random number between 1 and 100. See the Keil C51 Math Routines reference for more details. (To keep your program simple, it is fine to temporarily use a constant value as the seed for now, although this will result in the same sequence of random numbers with every game. You may also prompt the player to enter a random seed at the start of the game. To restrict the range of the random number generated by rand() to a maximum value of 100, you might find the modulus operator helpful.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!