1. iMove_with_Control_keys
This exercise is to try practice using control keys by a programming exercise to run Ike this. You can use arrow keys and other control keys to move a character within the rectangle area.
Now you can make it in this way:
-Prepare cIrToShow and drToHide that will have char moving effect.
-Initialization: Draw a boarder rectangle, show a help line, and draw a centered char.
-Start a loop until ESC is pressed
Read a key and process it based on the scan code of Arrow, Control Arrow, Home, ESC, and F1.
Make the boundary check to keep the that within the rectangle. To beep, write a char of ASCII code 7
Make the char moving by redrawing it with cIrToHide and clrToShow by calling.
2. Random_Color_Char_Screen_Fill
Write a program that fills each screen cell with a random character, in a random color. The characters could be printable from ASCII code 20h (Space) to 07Ah (lower case z) without control characters. Assign a 50% probability that the color of any character will be red. Assign a 25% probability of green and 25% of yellow. Display 50 random characters a line and then show 20 lines as the following is expected:
Now, you can simply call them in a loop to sot a color array bufColor and a char array bufCher selected. The requirement is to practice Windows API calls you just learned. So you can mile the 50 random characters per line with.
Attachment:- Assignment.rar