===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<math.h>
void main()
{
textbackground(1);
clrscr();
textcolor(0);
long double rc,ic,iz,rz,rz1,iz1,i,j,a,k,x,y,xscale,yscale,Ox,Oy,xstart,xend,ystart,yend,Zoomxscale,Zoomyscale,n,m;
char input;
Ox=-0.5;
Oy=0;
xstart=1;
xend=-2;
ystart=1;
yend=-1;
Zoomxscale=0.21;
Zoomyscale=0.14;
xscale=80/(xstart-xend);
yscale=24/(ystart-yend);
n=1;
m=1;
while(1==1)
{
xscale=80/(xstart-xend);
yscale=24/(ystart-yend);
/* xstart=Ox+40*(1/xscale);
xend=Ox-40*(1/xscale);
ystart=Oy+13*(1/yscale);
yend=Oy-13*(1/yscale);*/
for(i=ystart;i>=yend;i=i-(1/yscale))
{
for(j=xstart;j>=xend;j=j-(1/xscale))
{
rc=j;
ic=i;
for(rz=iz=0,k=0;k<=100;k++)
{
rz1=rz*rz-iz*iz+rc;
iz1=2*rz*iz+ic;
if(abs(rz1)>=2 || abs(iz1)>=2)
break;
rz=rz1;
iz=iz1;
}
x=(40-Ox*xscale)+rc*xscale+1;
y=(12-Oy*yscale)-ic*yscale+1;
if(x>=2 && x<=79 && y>=2 && y<=25)
{
gotoxy(x,y);
if(k<=10)
textcolor(11);
else if(k<=20)
textcolor(3);
else if(k<=30)
textcolor(9);
else if(k<=40)
textcolor(10);
else if(k<=50)
textcolor(14);
else if(k<=60)
textcolor(13);
else if(k<=70)
textcolor(5);
else if(k<=80)
textcolor(12);
else if(k<=90)
textcolor(4);
else
textcolor(0);
cprintf("Û");
}
}
}
input=getch();
if(input=='a')
{
Ox-=n*1/xscale;
xstart-=n*1/xscale;
xend-=n*1/xscale;
}
else if(input=='d')
{
Ox+=n*1/xscale;
xstart+=n*1/xscale;
xend+=n*1/xscale;
}
else if(input=='w')
{
Oy-=n*1/yscale;
ystart+=n*1/yscale;
yend+=n*1/yscale;
}
else if(input=='s')
{
Oy+=n*1/yscale;
ystart-=n*1/yscale;
yend-=n*1/yscale;
}
else if(input==' ')
{
Zoomxscale=0.21/m;
Zoomyscale=0.14/m;
xstart-=Zoomxscale;
xend+=Zoomxscale;
ystart-=Zoomyscale;
yend+=Zoomyscale;
}
else if(input==13)
{
Zoomxscale=0.21/m;
Zoomyscale=0.14/m;
xstart+=Zoomxscale;
xend-=Zoomxscale;
ystart+=Zoomyscale;
yend-=Zoomyscale;
}
else if(input=='1')
n=1;
else if(input=='2')
n=2;
else if(input=='3')
n=3;
else if(input=='4')
n=4;
else if(input=='5')
n=5;
else if(input=='6')
n=6;
else if(input=='7')
n=7;
else if(input=='8')
n=8;
else if(input=='9')
n=9;
else if(input=='~')
m=1;
else if(input=='!')
m=100;
else if(input=='@')
m=1000;
else if(input=='#')
m=10000;
else if(input=='$')
m=100000;
else if(input=='%')
m=1000000;
else if(input=='^')
m=10000000;
else if(input=='&')
m=100000000;
else if(input=='*')
m=1000000000;
else if(input=='(')
m=10000000000;
else if(input==27)
exit(0);
clrscr();
}
}
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<math.h>
void main()
{
textbackground(1);
clrscr();
textcolor(0);
long double rc,ic,iz,rz,rz1,iz1,i,j,a,k,x,y,xscale,yscale,Ox,Oy,xstart,xend,ystart,yend,Zoomxscale,Zoomyscale,n,m;
char input;
Ox=-0.5;
Oy=0;
xstart=1;
xend=-2;
ystart=1;
yend=-1;
Zoomxscale=0.21;
Zoomyscale=0.14;
xscale=80/(xstart-xend);
yscale=24/(ystart-yend);
n=1;
m=1;
while(1==1)
{
xscale=80/(xstart-xend);
yscale=24/(ystart-yend);
/* xstart=Ox+40*(1/xscale);
xend=Ox-40*(1/xscale);
ystart=Oy+13*(1/yscale);
yend=Oy-13*(1/yscale);*/
for(i=ystart;i>=yend;i=i-(1/yscale))
{
for(j=xstart;j>=xend;j=j-(1/xscale))
{
rc=j;
ic=i;
for(rz=iz=0,k=0;k<=100;k++)
{
rz1=rz*rz-iz*iz+rc;
iz1=2*rz*iz+ic;
if(abs(rz1)>=2 || abs(iz1)>=2)
break;
rz=rz1;
iz=iz1;
}
x=(40-Ox*xscale)+rc*xscale+1;
y=(12-Oy*yscale)-ic*yscale+1;
if(x>=2 && x<=79 && y>=2 && y<=25)
{
gotoxy(x,y);
if(k<=10)
textcolor(11);
else if(k<=20)
textcolor(3);
else if(k<=30)
textcolor(9);
else if(k<=40)
textcolor(10);
else if(k<=50)
textcolor(14);
else if(k<=60)
textcolor(13);
else if(k<=70)
textcolor(5);
else if(k<=80)
textcolor(12);
else if(k<=90)
textcolor(4);
else
textcolor(0);
cprintf("Û");
}
}
}
input=getch();
if(input=='a')
{
Ox-=n*1/xscale;
xstart-=n*1/xscale;
xend-=n*1/xscale;
}
else if(input=='d')
{
Ox+=n*1/xscale;
xstart+=n*1/xscale;
xend+=n*1/xscale;
}
else if(input=='w')
{
Oy-=n*1/yscale;
ystart+=n*1/yscale;
yend+=n*1/yscale;
}
else if(input=='s')
{
Oy+=n*1/yscale;
ystart-=n*1/yscale;
yend-=n*1/yscale;
}
else if(input==' ')
{
Zoomxscale=0.21/m;
Zoomyscale=0.14/m;
xstart-=Zoomxscale;
xend+=Zoomxscale;
ystart-=Zoomyscale;
yend+=Zoomyscale;
}
else if(input==13)
{
Zoomxscale=0.21/m;
Zoomyscale=0.14/m;
xstart+=Zoomxscale;
xend-=Zoomxscale;
ystart+=Zoomyscale;
yend-=Zoomyscale;
}
else if(input=='1')
n=1;
else if(input=='2')
n=2;
else if(input=='3')
n=3;
else if(input=='4')
n=4;
else if(input=='5')
n=5;
else if(input=='6')
n=6;
else if(input=='7')
n=7;
else if(input=='8')
n=8;
else if(input=='9')
n=9;
else if(input=='~')
m=1;
else if(input=='!')
m=100;
else if(input=='@')
m=1000;
else if(input=='#')
m=10000;
else if(input=='$')
m=100000;
else if(input=='%')
m=1000000;
else if(input=='^')
m=10000000;
else if(input=='&')
m=100000000;
else if(input=='*')
m=1000000000;
else if(input=='(')
m=10000000000;
else if(input==27)
exit(0);
clrscr();
}
}
===========================================================================
OUTPUT
Original:
Zoom Out:
Zoom In:
Moving Screen:
Zoom In:-
PLEASE CLICK HERE FOR OUTPUT VIDEO
Controls:
- W=> UP
- A=> Left
- D=> Right
- S=> Down
- Space=> Zoom In
- Enter=> Zoom Out
- Esc=> End Program
- {1,2,3,4,5,6,7,8,9}(any one at a time)=> Change No. of Lines Moving per Click while clinking W,A,S,D
- Shift+{1,2,3,4,5,6,7,8,9,`}(any one at a Time)=> Change Zoom Scale: Shift+1=> Zoom In/Out Quickly,......,Shift+9=> Zoom In/Out Slowly
No comments:
Post a Comment