Question: Need a C code that does this in visual studio. Exits if ESC was hit or plays another role everytime. Please make sure it runs

Need a C code that does this in visual studio.

Exits if ESC was hit or plays another role everytime. Please make sure it runs please and does the followings. Thanks in advance!Need a C code that does this in visual studio. Exits ifESC was hit or plays another role everytime. Please make sure itruns please and does the followings. Thanks in advance! Roll Two Dice

Roll Two Dice In this lab, you will write a program that will simulate the random rolling of two dice. The goals of the lab are for you to gain experience with: 1. The switch control structure. 2. Color printing in the console output window. 3. Writing your own functions. 4. Using the Sleep() function from windows.h to slow your program down. 5. Using rand() and srand() functions from stdlib.h. 6. Using time() function from time.h to seed the random number generator. See the sample Roll Two Dice.exe. Your program is to perform similarly. Your program will need to: 1. Print an intro (with your name, student number and set). 2. Print a rotating "hourglass figurine. 3. Obtain random values for each die. 4. Display the two dice side-by-side horizontally. 5. Print Hit ESC to exit, any other key to roll again..." 6. Repeat steps 2 to 5 in a loop. 7. Exit the loop and the program when the ESC key is hit. Notes: Make three functions and three functions only) to print, respectively, the first row, second row, and the third row of a die. Use a switch in each function. Use symbolic constants such as: #define ESC 27 //Escape key #define SQUARE 254 //small black square on a die #define BS 8 //backspace for the "hourglass #define WAIT 50 // wait time for the Sleep function Generate random seed based on current time: #include //time() srand( (int)time(NULL)); This program rolls two dice. Press any key to continue... Shaking dice now... I Hit ESC to exit, any other key to roll again... Shaking dice now... I 1 Hit ESC to exit, any other key to roll again... Shaking dice now... / . Hit ESC to exit, any other key to roll again... Suggestion : Breakdown color 2 divide & coni conquer 1. display color John color i 2. display die 3. generate random num

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!