Rectangles

 

Write a program that displays a 3 x 3 grid containing 9 red rectangles in color text mode. Each rectangle is 9 columns wide and 5 rows high. The grid is centered on the screen horizontally.


The following loop executes:

1. The user is prompted for an integer (0-8), which specifies the desired location of the blue square. Values 0-2 are the top row,
values 3-5 are the middle row, and values 6-8 are the bottom row.

2. The grid is redrawn with the blue square in the desired position.

3. If the user enters a value outside the range 0-8, the program clears the screen and exits.

This should be implemented as a 16-bit application.

No external library procedures may be called.