0% found this document useful (0 votes)
8 views2 pages

C++ Console Graphics Example Code

Uploaded by

Mitchel Vazquez
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

C++ Console Graphics Example Code

Uploaded by

Mitchel Vazquez
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

//po8

#include <windows.h>
#include <iostream>
using namespace std;
int main(){
int x, y;
int x1 = 1, y1 = 1, x2 = 80, y2 = 24, x3 = 2, y3 = 2, y4 = 23, y5 = 7, y6 =
79;

textbackground(0);
textcolor(14);

for (x = x2; x >= x1; x--) {


gotoxy(x, y1);
printf("%C",196);
//Sleep(5);
}
gotoxy(1,1);printf("%C",218);

for (y = y3; y <= y2; y++) {


gotoxy(x1, y);
printf("%C",179);
//Sleep(5);
}
gotoxy(1,24);printf("%C",192);

gotoxy(1,7);printf("%C",195);

for (x = x3; x <= x2; x++) {


gotoxy(x, y2);
printf("%C",196);
//Sleep(5);
}
gotoxy(80,24);printf("%C",217);

for (y = y4; y >= y3; y--) {


gotoxy(x2, y);
printf("%C",179);
//Sleep(5);
}
gotoxy(80,1);printf("%C",191);

gotoxy(80,7);printf("%C",180);

for (x = x3; x<= y6; x++) {


gotoxy(x, y5);
printf("%C",196);
//Sleep(5);
}

//RELLENO----------------------------------------------------------
textbackground(1);
for (y = y3; y<= (y5 - 1); y++){
if(y%2==0){
for(x=x3; x<=y6; x++){
gotoxy(x,y);
cout<<" ";
//Sleep(1);
}
}else{
for(x=y6; x>=x3; x--){
gotoxy(x,y);
cout<<" ";
//Sleep(1);
}
}
}

textbackground(2);

for (x = x3; x <= y6; x++) {

if (x % 2 == 0) {
for (y = (y5 + 1); y <= (y2 - 1); y++) {
gotoxy(x, y);
cout<<" ";
//Sleep(1);
}
} else {
for (y = (y2 - 1); y >= (y5 + 1); y--) {
gotoxy(x, y);
cout<<" ";
//Sleep(1);
}
}
}
textbackground(1);
textcolor(4);
gotoxy(40,3);
printf("IPN");

gotoxy(40,4);
printf("ESIME");

gotoxy(2,5);
printf("Alumno: Juan Carlos Gonzalez Lopez ");

gotoxy(50,5);
printf("Grupo: 1MM7");

textbackground(2);
textcolor(4);
gotoxy(40,14);
printf("HOLA");

getch();
}

You might also like