In this assignment you are requested to write a C++ program that displays the following colored pyramid on the screen:
- The pyramid is 71 characters wide and 21 characters high.
- To draw it, you need to draw green horizontal lines, then red and blue vertical lines.
- Used the following clarifications to write your program:
• The output screen can be thought of as a grid of 25 rows and 80 columns. Row 0 is at the upper edge of the screen. Column 0 is at the left edge of the screen.
• The intersection of a row and a column is a cell. A cell can display a single character.
• A cell is identified by its row and column numbers. These are its coordinates.
To be able to write starting from a specific position on the screen you have to include
#include<windows.h> .
• You have also to create a handle (an identifier) to reference the output screen:
HANDLE screen = GetStdHandle(STD_OUTPUT_HANDLE);
Comments
Leave a comment