Tuesday 19 January 2016

"VISION" without using graphics.h

void bar(int,int,int,int,char);  //row,col,x-axis,y-axis,char to print
void f_cross(int,int,int,char); //rows,x-axis,y-axis,char to print
void b_cross(int,int,int,char);   //row,x-axis,y-axis,char to print
#define S sleep(1)
void main()
{
clrscr();
f_cross(5,1,2,177);
S;
b_cross(5,8,2,177);   // V
S;
bar(5,3,18,2,177); // I
S;
bar(1,8,25,2,177);
S;
bar(1,3,25,3,177);
S;
bar(1,8,25,4,177);
S;
bar(1,3,30,5,177);
S;
bar(1,8,25,6,177);  //S
S;
bar(5,3,37,2,177);
S;
bar(4,3,43,2,177);  //I
S;
bar(1,3,46,2,177);
S;
bar(4,3,49,2,177);
S;
bar(1,9,43,6,177);  //O
S;
bar(5,3,55,2,177);
S;
f_cross(5,58,2,177);
S;
bar(5,3,65,2,177);
S;
getch();
}   // main close


void bar(int m,int n,int a,int b,char ch)
{
int i,j;
for(i=0;i<m;i++)
{
gotoxy(a,b+i);
for(j=0;j<n;j++)
{
printf("%c",ch);
}
printf("\n");
}
}

void f_cross(int m,int a,int b,char ch)
{
int i,j;
for (i=0;i<m;i++)
{
gotoxy(a,b+i);
for (j=0;j<i;j++)
{
printf(" ");
}
for(j=0;j<3;j++)
{
printf("%c",ch);
}
}
}
void b_cross(int m,int a,int b,char ch)
{
int i,j;
for (i=0;i<m;i++)
{
gotoxy(a,b+i);
for(j=m;j>i;j--)
{
printf(" ");
}
for(j=0;j<3;j++)
{
printf("%c",ch);
}
}
}