Thursday, 19 March 2015

Introduction to APPLET in java


                  SMILELY  &  CRIEY  programmed in java

--------------------------------------------------------------------------------------

//Back again , this time with  SMILELY  &  CRIEY  programmed in java. You can know how to interface  init() and paint().                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    //         ..........HAPPY CODING

 

        import java.io.*;
        import java.awt.event.*;
        import java.util.Scanner;
        import java.awt.*;
import java.applet.*;
        /*<applet code="smile" width=150 height=140></applet>*/
       

        public class smile extends Applet implements ActionListener {
        int r1,t=0,m;
        Button b1;
        Button b2,b3;
       
            public void init()
            {
                Color k=new Color(120,89,90);
                setBackground(k);

                 b1=new Button("PRESS TO GET CRIEY ");
               
                b1.setBounds(1970,2580,160,120);
                b1.setBackground(Color.red);
                b1.setForeground(Color.blue);
                b1.addActionListener(this);
                add(b1);
               
                 b2=new Button("PRESS TO GET SMIELY ");
                add(b2);
                //b1.setBounds(970,2580,160,920);
                b2.setBackground(Color.red);
                b2.setForeground(Color.blue);
                b2.addActionListener(this);
               
                 b3=new Button("MY WORDS ");
                   
                    b3.setBounds(1970,2580,160,120);
                    b3.setBackground(Color.red);
                    b3.setForeground(Color.blue);
                    b3.addActionListener(this);
                    add(b3);



            }
           
           
   
            public void paint(Graphics g)
            {  
                if(t==0)
                {
                   
                    g.setColor(Color.yellow);
                    g.fillOval(340,180,250,250);   
                    g.setColor(Color.black);
                    g.fillOval(390,260,35,35);
                    g.setColor(Color.black);
                    g.fillOval(500,260,35,35);   
                    g.setColor(Color.black);
                    for(int i=0;i<9;i++)
                    {g.drawArc(400,305,130+i,68+i,180,180);}
                   
                    g.setColor(Color.yellow);
                    g.fillOval(740,180,250,250);   
                    g.setColor(Color.black);
                    g.fillOval(790,260,35,35);
                    g.setColor(Color.black);
                    g.fillOval(900,260,35,35);   
                    g.setColor(Color.black);//1300,435
                    for(int i=0;i<9;i++)
                    {g.drawArc(800,325,130+i,68+i,0,180);}
                    for(int i=0;i<6;i++)
                    g.drawArc(800,325+i,130,68,15,165);
                }
           
                   
               if(t==2)
               {Color k=new Color(120,89,90);
                setBackground(k);

                g.setColor(Color.yellow);
                g.fillOval(540,180,250,250);   
                g.setColor(Color.black);
                g.fillOval(590,260,35,35);
                g.setColor(Color.black);
                g.fillOval(700,260,35,35);   
                g.setColor(Color.black);
                for(int i=0;i<9;i++)
                {g.drawArc(600,305,130+i,68+i,180,180);}
               
               }
               if(t==1)
                {Color k=new Color(120,89,90);
                setBackground(k);

       
                    g.setColor(Color.yellow);
                    g.fillOval(640,180,250,250);   
                    g.setColor(Color.black);
                    g.fillOval(690,260,35,35);
                    g.setColor(Color.black);
                    g.fillOval(800,260,35,35);   
                    g.setColor(Color.black);//1300,435
                    for(int i=0;i<9;i++)
                    {g.drawArc(700,330,130+i,68+i,0,180);}
                    for(int i=0;i<6;i++)
                    g.drawArc(700,330+i,130,68,15,165);
                }
                   

               if(t==3)
               {//Color k=new Color(2,3,4);
                setBackground(Color.WHITE);
                   Font font = new Font("Serif", Font.PLAIN, 34);
                  g.setFont(font);
                  g.setColor(Color.blue);
                  g.drawString("THANK  YOU ", 550, 180);
                  g.setColor(Color.CYAN);
                  g.drawString("FOR ", 610, 230);
                  g.setColor(Color.GREEN);
                  g.drawString("WATCHING ", 550, 280);
                  g.setColor(Color.BLACK);
                  g.drawString(".....viswadeep ", 850, 450);


                 
               }
            }
       

public void actionPerformed( ActionEvent ae) {
               
                String str=ae.getActionCommand();
               
                if (ae.getSource() == b1)
                {t=1;
                repaint();//calling paint() function
                }
               
                if (ae.getSource() == b2)
                {t=2;
                repaint();//calling paint() function
                }
               
                if (ae.getSource() == b3)
                {t=3;
                repaint();//calling paint() function
                }
   
        }


}

Tuesday, 17 March 2015

create ur own heder file for password. so others cannot see output of ur program, make it private.

                                    BILL CALCULATION PROGRAM WITH PASSWORD ACCESS
                                 ----------------------------------------------------------------------------------------

//PLEASE COMMENT ON THIS PROGRAM 

It has to be done in two steps :-

STEP(1) :- Paste below code in NOTEPAD of  INCLUDE folder of  C or C++  compiler .As u run the program it asks password it is secret ..........but only for u  it is  888 .Save this notepad with "password.h" extension.
//////////////////////////////////////////////////////////////////////////////////////
int password()                           |
{                                                |       part of program
int c;                                          |             to be     
char o;                                       |       placed  in   the      TURBOC=> BIN=> INCLUDE
c='o'*8;                                     |           INCLUDE  
return c;                                    |        folder of turbo
}                                               |            C   or  C++.
/////////////////////////////////////////////////////////////////////////////////////


STEP(2) :- Place this code in new file and save it as we do generally by giving file name of  your choice.
=>Shop bill is available to products listed below :- "britaniya";"threeroses";"colgate";"cellofinegrip";"ricebag";"doormat";"rexona";"dove";"sunfloweroil";
"rin";"dairymilk";"fa";
=>Some prodducts may not have product name so u can enter amount from '1' to  '30' instead of product name.


************************************************************************************


#include<graphics.h>
#include<iostream.h>
#include <conio.h>
#include<password.h>
#include<dos.h>
#include<string.h>
#include<process.h>
class visu
{public:
int i,p,l,z;char c[20];
void i1(char a[20])
{
strcpy(c,a);
l=strlen(c);
cout<<"Quantity of product         :  ";cin>>p;
}
void p1()
{

char c1[10]="britaniya";char c2[13]="threeroses";
char  c3[8]="colgate";char c4[15]="cellofinegrip";
char  c5[8]="ricebag";char c6[8]="doormat";
char  c7[8]="rexona";char c8[6]="dove";
char  c9[15]="sunfloweroil";char c10[5]="rin";
char  c11[10]="dairymilk";char c12[3]="fa";
char  c13[2]="3";char c14[2]="1";char c15[2]="2";
char c16[2]="4";char c17[2]="5";char c18[2]="6";char c19[2]="7";
char c20[2]="8";char c21[2]="9";char c22[3]="10";
char  c23[3]="11";char c24[3]="12";char c25[3]="13";
char c26[3]="14";char c27[3]="15";char c28[3]="16";char c29[3]="17";
char c30[3]="18";char c31[3]="19";char c32[3]="20";
char  c33[3]="21";char c34[3]="22";char c35[3]="23";char c36[3]="24";char c37[3]="25";char c38[3]="26";char c39[3]="27";char c40[3]="28";char c41[3]="29";char c42[3]="30";
if(strcmp(c,c1)==0){i=10;}
else if(strcmp(c,c2)==0){i=45;}else if(strcmp(c,c3)==0){i=54;}
else if(strcmp(c,c4)==0){i=6;}else if(strcmp(c,c5)==0){i=1200;}
else if(strcmp(c,c6)==0){i=30;}else if(strcmp(c,c7)==0){i=18;}
else if(strcmp(c,c8)==0){i=30;}else if(strcmp(c,c9)==0){i=70;}
else if(strcmp(c,c10)==0){i=10;}else if(strcmp(c,c11)==0){i=10;}
else if(strcmp(c,c12)==0){i=120;}else if(strcmp(c,c13)==0){i=3;}
else if(strcmp(c,c14)==0){i=1;}else if(strcmp(c,c15)==0){i=2;}
else if(strcmp(c,c16)==0){i=4;}else if(strcmp(c,c17)==0){i=5;}
else if(strcmp(c,c18)==0){i=6;}else if(strcmp(c,c19)==0){i=7;}
else if(strcmp(c,c20)==0){i=8;}else if(strcmp(c,c21)==0){i=9;}
else if(strcmp(c,c22)==0){i=10;}if(strcmp(c,c23)==0){i=11;}
else if(strcmp(c,c24)==0){i=12;}else if(strcmp(c,c25)==0){i=13;}
else if(strcmp(c,c26)==0){i=14;}else if(strcmp(c,c27)==0){i=15;}
else if(strcmp(c,c28)==0){i=16;}else if(strcmp(c,c29)==0){i=17;}
else if(strcmp(c,c30)==0){i=18;}else if(strcmp(c,c31)==0){i=19;}
else if(strcmp(c,c32)==0){i=20;}
else if(strcmp(c,c33)==0){i=21;}else if(strcmp(c,c34)==0){i=22;}else if(strcmp(c,c35)==0){i=23;}else if(strcmp(c,c36)==0){i=24;}else if(strcmp(c,c37)==0){i=25;}else if(strcmp(c,c38)==0){i=26;}else if(strcmp(c,c39)==0){i=27;}else if(strcmp(c,c40)==0){i=28;}else if(strcmp(c,c41)==0){i=29;}else if(strcmp(c,c42)==0){i=30;}
//else{cout<<"PRODUCT IS NOT AVAILABLE";}
//else{i=0;}
}
void s(int z)
{for(int y=0;y<z-l;y++)
{cout<<" ";
}
}
void s1(int z)
{for(int y=0;y<z-1;y++)
{cout<<" ";
}
}

int o1()
{
int m;
setcolor(2);
settextstyle(2,0,7);
outtextxy(21,5,"product            Quantity           Amount");


m=i*p;
cout<<"\n\n\n     "<<c;s(30);cout<<p;s1(27);cout<<m;return m;

}

};
void main()
{visu v[20]; char f[20]="e"; int r,b;
 char g[20]="a";
clrscr();
int a=DETECT,d,i=1,u,m=0,z;
initgraph(&a,&d,"C:\\TurboC3\\BGI");
cout<<"\n\n\n\n\n\n\n\n\n\n\n                                 ";
cout<<"password please :  ";
cin>>b;
r=password();
//cout<<r;
if(r==b)
{clrscr();cleardevice();
while(strcmp(g,f)!=0)
{
cout<<"\nName of product/Rs          :  ";
cin>>g;
if(strcmp(g,f)!=0)
{
v[i].i1(g);
v[i].p1(); i++;
cout<<"\n***********************   Press e to get bill   *****************************";cout<<"\n";
}
else
{
cout<<"\ncheck wether particulars are True(1) or Not(0) :";
cin>>u;
if(u==1)
{
clrscr();cleardevice();
}
else{
exit(0);
}
}
}
line(18,5,560,5);
line(18,33,560,33);
line(18,5,18,33);
line(560,5,560,33);

for(int j=1;j<=i-1;j++)
{
z=v[j].o1();
m=m+z;
}
setcolor(15);
line(18,33,18,i*46);
line(560,33,560,i*46);
line(18,i*46,560,i*46);
cout<<"\n\n\n                                                  TOTAL :     ";
cout<<m;
line(18,i*46,18,i*46+56);
line(560,i*46,560,i*46+56);
line(18,i*46+56,560,i*46+56);
}
else{
cout<<"\n\n\n\n\n\n\n\n\n\n\n                                 ";
cout<<"wrong password try again";
}
getch();
}
************************************************************************************

Thursday, 19 February 2015

FLAMES CALCULATOR PROGRAM IN JAVA

/*
Many of us in schooling did this manually but not by coding here is a program for u all.


                                                                     ...................Happy Coding


*/

package flame;
import java.io.IOException;
import java.util.Scanner;

public class Flame {
    public int k;
    public void i2(int y)
   {
     k=y;
if(k==2||k==4||k==7||k==9||k==20||k==22||k==25||k==2||k==4)
{System.out.println("             ENEMIES                                 ");}
else if(k==3||k==5||k==14||k==16||k==18||k==23)
{System.out.println("             FRIENDS                                ");}
else if( k==10||k==19)
{System.out.println("             LOVE                                ");}
else if
(k==12||k==8||k==13||k==17||k==28||k==30)
{System.out.println("             AFFECTION                                 ");}
else if
(k==6||k==11||k==15||k==26)
{System.out.println("            MARRIAGE                             ");}
else if(k==0)
{System.out.println("  NAMES ARE EQUAL      " );  }

else
{System.out.println("             SISTER                                 ");}

   }

public static void main(String args[])throws IOException
   {
int c,d,e,k,h,i,j,as1,as2;char i1,z,o;
 Flame f =new Flame();
    try{
          int u=0;
Scanner in=new Scanner(System.in);
System.out.println("enter names which u want to find relation");

StringBuffer f1=new StringBuffer(in.nextLine()) ;
StringBuffer g=new StringBuffer(in.nextLine()) ;
c=f1.length();
         d=g.length();

          for(int r1=0;r1<c;r1++)
          {
  as1=f1.charAt(r1);
  if((as1>=97&&as1<=122)||(as1>=65&&as1<=90)){u=u;}
  else{u=u+1;}
          }
          for(int r2=0;r2<d;r2++)
          {
  as2=g.charAt(r2);
  if((as2>=97&&as2<=122)||(as2>=65&&as2<=90)){u=u;}
  else{u=u+1;}
          }
          if(u==0)
          {
              e=c+d;
     h=0;
   for(i=0;i<c;i++)
     { for(j=0;j<d;j++)
   {
    if(f1.charAt(i)==g.charAt(j))
      {h++; f1.setCharAt(i,'Z');g.setCharAt(j,'o'); }
    else
        {h=h;}
   }
     }

  k=e-(2*h);
 
  f.i2(k);
 
          }
 
            else
           {
    System.out.println("  RELATION CANNOT BE DETERMINED ");
  }
       }

catch (Exception di)
{
 
   System.out.println(" RELATION CANNOT BE DETERMINED ");
   System.out.println(di);
}
     }  
}

Sunday, 16 November 2014

u get what u give by java programing

import java.io.*;
public class avisu {
    public static void main(String args[]){
        byte[] data = new byte[40];
        try{
            System.in.read(data);
        }
        catch(IOException e){
            System.out.println("no info");
        }
        String s = new String(data);
        System.out.println(s);
    }  

}

Thursday, 28 August 2014

Car Game in CPP

                                    CARX   game using   CPP

=> Many of us think making games out of cpp is very difficult but it is not so. By using simple graphics in cpp we can create games.



                                                              ...........Happy Coading










****************************************************************************** 
#include<math.h>
#include<graphics.h>
#include<iostream.h>
#include <conio.h>
#include<dos.h>
#include<stdlib.h>
#include<bios.h>
#define RIGHT 19712
#define LEFT 19200
#define UP 18432
#define DOWN 20480
class visu
{ public:
int x,y,m,o,key,sc,c11,s1,y1;int R;
 void pq()
{
setfillstyle(5,4);
bar (460,234,470,414);
bar (580,234,590,414);
bar (470,394,590,414);
  setfillstyle(8,4);
bar (440,224,610,234);

}
  //////////////////////////////////////////////////////////////////////////
  void baq(int i)
  {
  setfillstyle(8,0);
bar (440+i,224,610+i,234);

  setfillstyle(8,4);
bar (440+i,224,610+i,234);
delay(20);
  setfillstyle(8,0);
bar (440+i,224,610+i,234);

  }
  //////////////////////////////////////////////////////////////////////////////
  void baq1(int p1)
  {
  setcolor(8);
  settextstyle(2,0,9);
outtextxy(450+p1,196," SCORE");
  setcolor(0);
  delay(20);
  settextstyle(2,0,9);
outtextxy(450+p1,196," SCORE");

  }
 ///////////////////////////////////////////////////////////////////////////
  void smq(int i)
{
setfillstyle(1,14);
fillellipse(460+i,155,50,50);
setfillstyle(1,0);
fillellipse(440+i,148,5,10);
fillellipse(480+i,143,5,10);
setcolor(0);
arc(460+i,155,210,330,33);

delay(40);
setfillstyle(1,0);
fillellipse(460+i,155,50,50);
setfillstyle(1,0);
fillellipse(440+i,148,5,10);
fillellipse(480+i,143,5,10);
setcolor(0);
arc(460+i,155,210,330,33);
//delay(180);
}
//////////////////////////////////////////////////////////////////////////
void crq(int i)
{
setfillstyle(1,14);
fillellipse(460+67,155+i,50,50);
setfillstyle(1,0);
fillellipse(440+67,147+i,4,9);
fillellipse(480+67,147+i,4,9);
setcolor(0);
arc(460+67,195+i,30,150,28);
delay(30);
setfillstyle(1,0);
fillellipse(460+67,155+i,50,50);
setfillstyle(1,0);
fillellipse(440+67,147+i,4,9);
fillellipse(480+67,147+i,4,9);
setcolor(0);
arc(460+67,195,30,150,28);

}

///////////////////////////////////////////////////////////////////////////
 void sm()
{
setfillstyle(1,14);
fillellipse(460,155,50,50);
setfillstyle(1,0);
fillellipse(440,148,5,10);
fillellipse(480,143,5,10);
setcolor(0);
arc(460,155,210,330,33);
}
//////////////////////////////////////////////////////////////////////////
void cr()
{
setfillstyle(1,14);
fillellipse(460,155,50,50);
setfillstyle(1,0);
fillellipse(440,147,4,9);
fillellipse(480,147,4,9);
setcolor(0);
arc(460,195,30,150,28);
}
//////////////////////////////////////////////////////////////////////////
 void y9(int x,int y8,int t,int f,int f1,int f2,int h)
 { setcolor(f);
rectangle(x+10-t-h,y8,x+90-t-h,y8+30) ;
line(x+10-t-h,y8+4,x+90-t-h,y8+4);
line(x+10-t-h,y8+26,x+90-t-h,y8+26);
setcolor(f);
line(x-t-h,y8+30,x-30-t-h,y8+30);
line(x-t-h,y8+30,x-t-h,y8+10);
line(x-t-h,y8+10,x-10-t-h,y8+10);
line(x-10-t-h,y8+10,x-18-t-h,y8+18);
line(x-18-t-h,y8+18,x-30-t-h,y8+18);
line(x-30-t-h,y8+18,x-30-t-h,y8+30);
line(x+20-t-h,y8+30,x+20-t-h,y8+35);
line(x+20-t-h,y8+35,x-10-t-h,y8+35);
line(x-10-t-h,y8+35,x-10-t-h,y8+30);
line(x+9-t-h,y8+30,x+9-t-h,y8+35);
line(x-9-t-h,y8+35,x-9-t-h,y8+30);
line(x+19-t-h,y8+30,x+19-t-h,y8+35);
line(x-t-h,y8+15,x+10-t-h,y8+15);
line(x-t-h,y8+16,x+10-t-h,y8+16);
line(x-t-h,y8+14,x+10-t-h,y8+14);
for(int y13=0;y13<7;y13++)
{
circle(x-20-t-h,y8+36,y13);
}
for(int y23=0;y23<7;y23++)
{
circle(x+60-t-h,y8+36,y23);
}
for(int y34=0;y34<7;y34++)
{
circle(x+75-t-h,y8+36,y34);
}
line(x-18-t-h,y8+18,x-t-h,y8+18);
line(x-3-t-h,y8+18,x-3-t-h,y8+10);
line(x-10-t-h,y8+10,x-10-t-h,y8+18);
line(x-18-t-h,y8+18,x-18-t-h,y8+26);
line(x-18-t-h,y8+26,x-5-t-h,y8+26);
line(x-5-t-h,y8+26,x-5-t-h,y8+18);
setcolor(f1);
settextstyle(1,0,2);
outtextxy(x+5-t-21-h,y8+5,"   CAR");
setcolor(f2);
settextstyle(4,0,4);
outtextxy(x+5-t+50-h,y8-7,"x ");
//delay(4100);

 }
////////////////////////////////////////////////////////////////////////////
 void lf(int x,int y,int t)
{
 setcolor(2);
rectangle(x+10-t,y,x+90-t,y+30) ;
line(x+10-t,y+4,x+90-t,y+4);
line(x+10-t,y+26,x+90-t,y+26);
setcolor(4);
settextstyle(1,0,2);
outtextxy(x+5-t,y+5,"   CAR");
setcolor(2);
line(x-t,y+30,x-30-t,y+30);
line(x-t,y+30,x-t,y+10);
line(x-t,y+10,x-10-t,y+10);
line(x-10-t,y+10,x-18-t,y+18);
line(x-18-t,y+18,x-30-t,y+18);
line(x-30-t,y+18,x-30-t,y+30);
line(x+20-t,y+30,x+20-t,y+35);
line(x+20-t,y+35,x-10-t,y+35);
line(x-10-t,y+35,x-10-t,y+30);
line(x+9-t,y+30,x+9-t,y+35);
line(x-9-t,y+35,x-9-t,y+30);
line(x+19-t,y+30,x+19-t,y+35);
line(x-t,y+15,x+10-t,y+15);
line(x-t,y+16,x+10-t,y+16);
line(x-t,y+14,x+10-t,y+14);
for(int y1=0;y1<7;y1++)
{
circle(x-20-t,y+36,y1);
}
for(int y2=0;y2<7;y2++)
{
circle(x+60-t,y+36,y2);
}
for(int y3=0;y3<7;y3++)
{
circle(x+75-t,y+36,y3);
}
line(x-18-t,y+18,x-t,y+18);
line(x-3-t,y+18,x-3-t,y+10);
line(x-10-t,y+10,x-10-t,y+18);
line(x-18-t,y+18,x-18-t,y+26);
line(x-18-t,y+26,x-5-t,y+26);
line(x-5-t,y+26,x-5-t,y+18);
delay(10);
setcolor(0);
rectangle(x+10-t,y,x+90-t,y+30) ;
line(x+10-t,y+4,x+90-t,y+4);
line(x+10-t,y+26,x+90-t,y+26);
settextstyle(1,0,2);
outtextxy(x+5-t,y+5,"   CAR");
line(x-t,y+30,x-30-t,y+30);
line(x-t,y+30,x-t,y+10);
line(x-t,y+10,x-10-t,y+10);
line(x-10-t,y+10,x-18-t,y+18);
line(x-18-t,y+18,x-30-t,y+18);
line(x-30-t,y+18,x-30-t,y+30);
line(x+20-t,y+30,x+20-t,y+35);
line(x+20-t,y+35,x-10-t,y+35);
line(x-10-t,y+35,x-10-t,y+30);
line(x+9-t,y+30,x+9-t,y+35);
line(x-9-t,y+35,x-9-t,y+30);
line(x+19-t,y+30,x+19-t,y+35);
line(x-t,y+15,x+10-t,y+15);
line(x-t,y+16,x+10-t,y+16);
line(x-t,y+14,x+10-t,y+14);
for(int y11=0;y11<7;y11++)
{
circle(x-20-t,y+36,y11);
}
for(int y22=0;y22<7;y22++)
{
circle(x+60-t,y+36,y22);
}
for(int y33=0;y33<7;y33++)
{
circle(x+75-t,y+36,y33);
}
line(x-18-t,y+18,x-t,y+18);
line(x-3-t,y+18,x-3-t,y+10);
line(x-10-t,y+10,x-10-t,y+18);
line(x-18-t,y+18,x-18-t,y+26);
line(x-18-t,y+26,x-5-t,y+26);
line(x-5-t,y+26,x-5-t,y+18);
}

////////////////////////////////////////////////////////////////////////////
void q(int z,int x,int c,int v ,int b)
{
setcolor(b);
rectangle(z,x,c,v);
for(int e=0;e<26;e++)
{setcolor(b);
line(z+e,x,c+e,v);
}
}
///////////////////////////////////////////////////////////////////////////////
void q1(int x,int y)
{
/*setcolor(2);
settextstyle(1,0,6);
outtextxy(170,60,"CAR ");
//delay(100);
setcolor(9);
settextstyle(4,0,8);
outtextxy(260,38,"x ");    */

setcolor(13);
settextstyle(4,0,3);
outtextxy(210,190,"loading ");

setcolor(WHITE);
rectangle(189,240,449,269);
for(int u=0;u<2;u++)
{
for(int u=0;u<170;u++)
{ u=u+5;
q(192+u,244,192+u,265,2);
q(220+u,244,220+u,265,2);
q(248+u,244,248+u,265,2);
delay(135);
q(192+u,244,192+u,265,0);
q(220+u,244,220+u,265,0);
q(248+u,244,248+u,265,0);
}
 }
int  y11=265;
for(int p=0;p<260;p++)
{
setcolor(9);
line(189+p,240,189+p,269);
y--;
if(200<y11<260)
{
delay(10);
}
else if(150<y11<200)
{
delay(9);
}
else if(50<y11<150)
{
delay(8);
}
else
{
delay(7);
}
}
}
////////////////////////////////////////////////////////////////////////////
void r1(int z)
{
setcolor(z);
line(300,74,300,134);
setfillstyle(1,z);
bar (200,74,220,134);
bar (380,74,400,134);

line(300,174,300,234);
bar (200,174,220,234);
bar (380,174,400,234);

line(300,274,300,334);
bar (200,274,220,334);
bar (380,274,400,334);

line(300,374,300,434);
bar (200,374,220,434);
bar (380,374,400,434);

}
////////////////////////////////////////////////////////////////////////////
r2(int z)
{
setcolor(z);
line(300,34,300,94);
setfillstyle(1,z);
bar (200,34,220,94);
bar (380,34,400,94);

line(300,134,300,194);
bar (200,134,220,194);
bar (380,134,400,194);

line(300,234,300,294);
bar (200,234,220,294);
bar (380,234,400,294);

line(300,334,300,394);
bar (200,334,220,394);
bar (380,334,400,394);


}
///////////////////////////////////////////////////////////////////////////
void r3(int z)
{
setcolor(z);
line(300,34,300,54);
setfillstyle(1,z);
bar (200,34,220,54);
bar (380,34,400,54);

line(300,94,300,154);
bar (200,94,220,154);
bar (380,94,400,154);

line(300,194,300,254);
bar (200,194,220,254);
bar (380,194,400,254);

 line(300,294,300,354);
bar (200,294,220,354);
bar (380,294,400,354);

line(300,394,300,434);
bar (200,394,220,434);
bar (380,394,400,434);
}
////////////////////////////////////////////////////////////////////////////
void r4(int z)
{
setcolor(z);
line(300,54,300,114);
setfillstyle(1,z);
bar (200,54,220,114);
bar (380,54,400,114);

line(300,154,300,214);
bar (200,154,220,214);
bar (380,154,400,214);

line(300,254,300,314);
bar (200,254,220,314);
bar (380,254,400,314);

line(300,354,300,414);
bar (200,354,220,414);
bar (380,354,400,414);
}
/////////////////////////////////////////////////////////////////////////////
void r5(int z)
{
setcolor(z);
line(300,34,300,74);
setfillstyle(1,z);
bar (200,34,220,74);
bar (380,34,400,74);

line(300,114,300,174);
bar (200,114,220,174);
bar (380,114,400,174);

line(300,214,300,274);
bar (200,214,220,274);
bar (380,214,400,274);

line(300,314,300,374);
bar (200,314,220,374);
bar (380,314,400,374);
line(300,414,300,434);
bar (200,414,220,434);
bar (380,414,400,434);

}
////////////////////////////////////////////////////////////////////////////
void car(int row,int col,int op,int color)
   {
int r=row,c=col;

switch(op)
{
case LEFT :c=col+1;break;
case RIGHT:c=col-1; break;
case UP   :r=row+1;break;
case DOWN :r=row-1; break;
}



setcolor(0);
line(240+c*80,39+r*80,240+c*80,109+r*80);
line(280+c*80,39+r*80,280+c*80,109+r*80);
arc(260+c*80,74+r*80,59,119,38);
arc(260+c*80,74+r*80,59,120,41);
arc(260+c*80,74+r*80,239,302,38);
arc(260+c*80,74+r*80,239,302,41);
rectangle(250+c*80,69+r*80,270+c*80,88+r*80);
arc(260+c*80,89+r*80,55,125,30);
line(250+c*80,69+r*80,240+c*80,64+r*80);
line(270+c*80,69+r*80,280+c*80,64+r*80);
line(270+c*80,88+r*80,280+c*80,96+r*80);
line(250+c*80,88+r*80,240+c*80,96+r*80);
line(240+c*80,96+r*80,280+c*80,96+r*80);
line(240+c*80,96+r*80,250+c*80,88+r*80);
line(240+c*80,96+r*80,245+c*80,109+r*80);
line(280+c*80,96+r*80,275+c*80,109+r*80);
line(245+c*80,62+r*80,252+c*80,34+r*80);
line(275+c*80,62+r*80,270+c*80,35+r*80);
line(260+c*80,59+r*80,260+c*80,35+r*80);
line(270+c*80,79+r*80,276+c*80,79+r*80);
line(244+c*80,79+r*80,250+c*80,79+r*80);
line(276+c*80,79+r*80,280+c*80,64+r*80);
line(276+c*80,79+r*80,280+c*80,96+r*80);
line(244+c*80,79+r*80,240+c*80,64+r*80);
line(244+c*80,79+r*80,240+c*80,96+r*80);
setcolor(color);
line(240+col*80,39+row*80,240+col*80,109+row*80);
line(280+col*80,39+row*80,280+col*80,109+row*80);
arc(260+col*80,74+row*80,59,119,38);
arc(260+col*80,74+row*80,59,120,41);
arc(260+col*80,74+row*80,239,302,38);
arc(260+col*80,74+row*80,239,302,41);
rectangle(250+col*80,69+row*80,270+col*80,88+row*80);
arc(260+col*80,89+row*80,55,125,30);
line(250+col*80,69+row*80,240+col*80,64+row*80);
line(270+col*80,69+row*80,280+col*80,64+row*80);
line(270+col*80,88+row*80,280+col*80,96+row*80);
line(250+col*80,88+row*80,240+col*80,96+row*80);
line(240+col*80,96+row*80,280+col*80,96+row*80);
line(240+col*80,96+row*80,250+col*80,88+row*80);
line(240+col*80,96+row*80,245+col*80,109+row*80);
line(280+col*80,96+row*80,275+col*80,109+row*80);
line(245+col*80,62+row*80,252+col*80,34+row*80);
line(275+col*80,62+row*80,270+col*80,35+row*80);
line(260+col*80,59+row*80,260+col*80,35+row*80);
line(270+col*80,79+row*80,276+col*80,79+row*80);
line(244+col*80,79+row*80,250+col*80,79+row*80);
line(276+col*80,79+row*80,280+col*80,64+row*80);
line(276+col*80,79+row*80,280+col*80,96+row*80);
line(244+col*80,79+row*80,240+col*80,64+row*80);
line(244+col*80,79+row*80,240+col*80,96+row*80);

    }
////////////////////////////////////////////////////////////////////////////
void cln(int c)
      {int r=4;
setfillstyle(SOLID_FILL,BLACK);
setcolor(0);
//setcolor(0);
//circle(257+c*80,39+r*80,35);

  line(240+c*80,39+r*80,240+c*80,109+r*80);
line(280+c*80,39+r*80,280+c*80,109+r*80);
arc(260+c*80,74+r*80,59,119,38);
arc(260+c*80,74+r*80,59,120,41);
arc(260+c*80,74+r*80,239,302,38);
arc(260+c*80,74+r*80,239,302,41);
rectangle(250+c*80,69+r*80,270+c*80,88+r*80);
arc(260+c*80,89+r*80,55,125,30);
line(250+c*80,69+r*80,240+c*80,64+r*80);
line(270+c*80,69+r*80,280+c*80,64+r*80);
line(270+c*80,88+r*80,280+c*80,96+r*80);
line(250+c*80,88+r*80,240+c*80,96+r*80);
line(240+c*80,96+r*80,280+c*80,96+r*80);
line(240+c*80,96+r*80,250+c*80,88+r*80);
line(240+c*80,96+r*80,245+c*80,109+r*80);
line(280+c*80,96+r*80,275+c*80,109+r*80);
line(245+c*80,62+r*80,252+c*80,34+r*80);
line(275+c*80,62+r*80,270+c*80,35+r*80);
line(260+c*80,59+r*80,260+c*80,35+r*80);
line(270+c*80,79+r*80,276+c*80,79+r*80);
line(244+c*80,79+r*80,250+c*80,79+r*80);
line(276+c*80,79+r*80,280+c*80,64+r*80);
line(276+c*80,79+r*80,280+c*80,96+r*80);
line(244+c*80,79+r*80,240+c*80,64+r*80);
line(244+c*80,79+r*80,240+c*80,96+r*80);

  }
////////////////////////////////////////////////////////////////////////////
void opp(int row,int col,int c)
{
car(row++,col,DOWN,c);
}
////////////////////////////////////////////////////////////////////////////
void first(int x,int y)
{
setcolor(0);
setfillstyle(1,0);
fillellipse(x,y,140,100) ;
setcolor(15);
settextstyle(1,0,8);
outtextxy(235,172,"SNHV");
setcolor(25);
settextstyle(1,0,1);
outtextxy(285,277,"PRESENTS");
for(int u=1;u<10;u++)
{
setcolor(14);
ellipse(x,y,0,360,140+u,100+u) ;
}
for(int u1=10;u1<20;u1++)
{
setcolor(12);
ellipse(x,y,0,360,140+u1,100+u1) ;
}
for(int u2=20;u2<23;u2++)
{
setcolor(7);
ellipse(x,y,0,360,140+u2,100+u2) ;
 }
 delay(300);
 //////////////////////////////////////////
setcolor(0);
setfillstyle(1,0);
fillellipse(x,y,140,100) ;



for(int y7=0;y7<3;y7++)
{

for(int y5=1;y5<141;y5++)
{
setcolor(0);
setfillstyle(9,2);
fillellipse(x,y,140-y5,100) ;
}
for(int y6=1;y6<141;y6++)
{
setcolor(0);
setfillstyle(7,2);
fillellipse(x,y,y6,100) ;
}
}
delay(200);

for(int y61=1;y61<141;y61++)
{
setcolor(0);
setfillstyle(1,15);
fillellipse(x,y,y61,100) ;
}

for(int y51=1;y51<141;y51++)
{
setcolor(15);
setfillstyle(1,15);
fillellipse(x,y,140-y51,100) ;
}
setcolor(1);
settextstyle(4,0,8);
outtextxy(195,172,"VISU");
setcolor(2);
settextstyle(1,0,2);
outtextxy(395,247,"sports");

sleep(3);
}

//////////////////////////////////////////////////////////////////////////
void pg1()
{
int j,p1,y1,y3,s3;
cleardevice();
setcolor(8);
settextstyle(2,0,8);
outtextxy(160,180,"1] CUSTOMERISE ");
outtextxy(160,225,"2] GUIDE ");
outtextxy(160,270,"3] GAME SETTINGS ");
outtextxy(160,315,"4] ABOUT ");
cout<<"\n"<<"                                                                     NEXT :0";
setcolor(5);
settextstyle(2,0,7);
outtextxy(60,350,"select what you want : ");
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                         ";
cin>>j;
cleardevice();clrscr();cleardevice();
    if(j==0)
    {deep(x,y,m,o,s3);
    }
else if(j==3)
{cleardevice();

setcolor(2);
settextstyle(1,0,4);
outtextxy(130,20,"SOUND ");
setcolor(1);
settextstyle(1,0,2);
outtextxy(130,70,"1] MUTE ");
outtextxy(130,100,"2] MEDIUM ");
outtextxy(130,130,"3] HIGH ");

cin>>s1;
if(s1==1)
{s3=0;
}
else if(s1==2)
{s3=300;
}
else if(s1==3)
{ s3==1200;  }
else
{s3==1000
;
}

pg1();
}
else if(j==2)
{cleardevice();
setcolor(14);
settextstyle(1,0,7);
outtextxy(110,20,"GUIDE ");
setcolor(3);
settextstyle(5,0,4);
outtextxy(10,120,"*press up arrow to move up ");
settextstyle(5,0,4);
outtextxy(10,160,"*press down arrow to move down ");
settextstyle(5,0,4);
outtextxy(10,200,"*press left arrow to move left ");
settextstyle(5,0,4);
outtextxy(10,240,"*press right arrow to move right ");
settextstyle(5,0,4);
outtextxy(10,280,"*as score increases cars approach faster");

cout<<"<=BACK:0     ";
cin>>y1; cleardevice();
if(y1==0)
{
pg1();
}

}
else if(j==4)
{cleardevice();
setcolor(14);
settextstyle(1,0,7);
outtextxy(110,20,"ABOUT ");
setcolor(3);
settextstyle(5,0,4);
outtextxy(10,120,"*By using arrow keys overtake the cars.");
outtextxy(10,160," speed need not to be controlled sound ");
outtextxy(10,210,"  will arrive as soon as ur car touches");
outtextxy(10,270, "  other if uturn on sound ");
settextstyle(5,0,4);

cout<<"<=BACK:0     ";
cin>>y3; cleardevice();
if(y3==0)
{
pg1();
}

}
else if(j==1)
{
setcolor(6);
settextstyle(5,0,4);
outtextxy(75,20,"SELECT UR CAR COLOR ");
settextstyle(2,0,8);
setcolor(1);
outtextxy(75,110,"1] BLUE ");
setcolor(2);
outtextxy(400,110,"2] GREEN ");
setcolor(3);
outtextxy(75,155,"3] AQUO ");
setcolor(4);
outtextxy(400,155,"4] RED ");
setcolor(5);
outtextxy(75,200,"5] PURPLE ");
setcolor(6);
outtextxy(400,200,"6] BROWN ");
setcolor(7);
outtextxy(75,245,"7] GRAY ");
setcolor(13);
outtextxy(400,245,"13] MEGRAINE ");
setcolor(14);
outtextxy(75,290,"14] YELLOW ");
setcolor(15);
outtextxy(400,290,"15] WHITE ");

cin>>m ;
cleardevice();
setcolor(8);
settextstyle(5,0,4);
outtextxy(75,20,"SELECT OVERTAING CAR COLOR ");
settextstyle(2,0,8);
setcolor(1);
outtextxy(75,110,"1] BLUE ");
setcolor(2);
outtextxy(400,110,"2] GREEN ");
setcolor(3);
outtextxy(75,155,"3] AQUO ");
setcolor(4);
outtextxy(400,155,"4] RED ");
setcolor(5);
outtextxy(75,200,"5] PURPLE ");
setcolor(6);
outtextxy(400,200,"6] BROWN ");
setcolor(7);
outtextxy(75,245,"7] GRAY ");
setcolor(13);
outtextxy(400,245,"13] MEGRAINE ");
setcolor(14);
outtextxy(75,290,"14] YELLOW ");
setcolor(15);
outtextxy(400,290,"15] WHITE ");

cin>>o ;
cleardevice();
pg1();

}cleardevice();
deep(x,y,m,o,s1);
}

////////////////////////////////2222222222222222222222222222222222222222222222

void uf()
{clrscr();
cleardevice();
pq();
for(int i=0;i<55;i++)
{
smq(i);
}
setfillstyle(1,14);
fillellipse(460+55,155,50,50);
setfillstyle(1,0);
fillellipse(440+55,148,5,10);
fillellipse(480+55,143,5,10);
setcolor(0);
arc(460+55,155,210,330,33);

for(int p=0;p<140;p++)
{
baq(p);
}
setfillstyle(8,4);
bar (440+140,224,610+140,234);

setfillstyle(1,0);
fillellipse(460+55,155,50,50);
setfillstyle(1,0);
fillellipse(440+55,148,5,10);
fillellipse(480+55,143,5,10);
setcolor(0);
arc(460+55,155,210,330,33);
sound(1000);
//////////////////////////////////////////////////////////////////////////////
for(int i1=0;i1<100;i1++)
{int j1;
j1=i1++;
crq(j1);
}
setfillstyle(1,14);
fillellipse(460+66,155+185,50,50);
setfillstyle(1,0);
fillellipse(440+66,147+185,4,9);
fillellipse(480+66,147+185,4,9);
setcolor(0);
arc(460+66,195+180,30,155,28);
for(int p1=140;p1>0;p1--)
{
baq(p1);                              //bar (440+i,224,610+i,234);
baq1(p1);

}  nosound();
  setfillstyle(8,4);
bar (440,224,610,234);
  setcolor(1);
  settextstyle(1,0,3);
outtextxy(480,245," U LOST");
  setcolor(8);
  settextstyle(2,0,9);
outtextxy(465,196," SCORE");
setcolor(5);
  settextstyle(2,0,8);
outtextxy(160,180,"1] QUIT");
outtextxy(160,220,"2] NEW GAME");

//sleep(2);*/
}

//*************************************************************************
//car movement

void deep(int x,int y,int m,int o,int s3)
{  clrscr();cleardevice();char xq;
setfillstyle(1,2);
bar (0,34,200,434);
bar (400,34,600,434);
sm();
int row1=0,row2=-2,col1,col2,col3,p=0,p1,R1,R2;
int row=4,col=0;
int r=row,c=col;
unsigned int op;
col1=rand()%2;
col2=rand()%2;
col3=rand()%2;
  sc=0;
r1(15);
car(4,0,op,m);
while(key!=2)
{
   while(bioskey(1)==0)
 {gotoxy(9,9);
 cout<<"score:"<<sc;

   sc=sc+10;
 while(kbhit()==0)
{

  p++;
if(row1==row&&col1==col)
{ cr();
setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200," DEFEATED");
sound(s3);delay(3000);nosound();
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();
uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                             "<< sc;
gotoxy(120,120);
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"            ";
cin>>y1;
if(y1==1)
{
exit(0);
break;// break;  ////////////////////exit(0);
}
else if(y1==2)
{ clrscr();
cleardevice();
pg1();
clrscr();
cleardevice() ;
uf();
}
}
else if(row2==row&&col2==col)
{cr();
setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200,"DEFEATED");
//uf();
sound(s3);delay(3000);nosound();
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();

uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                              "<<sc;
gotoxy(120,120);
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"               ";

cin>>y1;
if(y1==1)
{exit(0);
 break;
}
else if(y1==2)
{ clrscr();
cleardevice();
pg1();
clrscr();

cleardevice() ;
uf();
}

//cout<<"defeated";
// break;
}
 if(row1<5)
{
r1(0);
r2(15);
opp(row1,col1,o);
opp(row2,col2,o);
//r1();

if(row1==4)
{     if(row==0&&col==col3)
       {cr();
       setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200," DEFEATED");
//uf();
sound(s3);delay(3000);nosound();
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();

uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                             " <<sc;
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"            ";

gotoxy(120,120);
cin>>y1;

if(y1==1)
{
 exit(0);
 break;
}
else if(y1==2)
{
clrscr();
cleardevice();
pg1();
clrscr();

cleardevice() ;
uf();
}

       //cout<<"defeated";
//    break;
       }

else if(row1==row&&col1==col)
{cr();
setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200," DEFEATED");
//uf();
sound(s3);delay(3000);nosound();
cout<<"prees any char to get score board";cin>>xq;
 clrscr();cleardevice();

uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                             " <<sc;
gotoxy(120,120);
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"           ";

cin>>y1;

if(y1==1)
{ exit(0);
 break;
}
else if(y1==2)
{
clrscr();

cleardevice();
pg1();
clrscr();

cleardevice() ;
uf();
}

//cout<<"defeated";
// break;
}
else if(row2==row&&col2==col)
{cr();
setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200,"DEFEATED");
//uf();
sound(s3);delay(3000);nosound();
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();

uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                              "<<sc;
gotoxy(120,120);
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"               ";

cin>>y1;

if(y1==1)
{ exit(0);
 break;
}
else if(y1==2)
{clrscr();

cleardevice();
pg1();
clrscr();

cleardevice() ;
uf();
}

//cout<<"defeated";
// break;
}

r2(0);
r3(15);
opp(0,col3,o);
//r2();
}
}

else
{ cln(col1);
row1=row2;
row2=1;
col1=col2;col2=col3;
col3=rand()%2;
 if(row2==row&&col2==col)
{
cr();
setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200," DEFEATED");
//uf();
sound(s3);delay(3000);nosound();
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();

uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                             "<< sc;
gotoxy(120,120);
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                ";

  cin>>y1;

  if(y1==1)
{ exit(0);
 break;
}
else if(y1==2)
{clrscr();

cleardevice();
pg1();
cleardevice() ;
clrscr();

uf();
}

//cout<<"defeated";
// break;
}
r3(0);
r4(15);
opp(row1,col1,o);
opp(row2,col2,o);
//r1();
}R1=row1;R2=row2;
row1++;row2++;
if(sc<=50)
{delay(550);
gotoxy(9,20);
cout<<"speed:40 kmph";
}
else if(sc>50&&sc<=200)
{delay(500);
gotoxy(9,20);
cout<<"speed:50 kmph";
}
else if(sc>200&&sc<=300)
{delay(480); gotoxy(9,20);
cout<<"speed:80 kmph";
}
else if(sc>300&&sc<=400)
{delay(460); gotoxy(9,20);
cout<<"speed:100 kmph";
}
else if(sc>400&&sc<=500)
{delay(430); gotoxy(9,20);
cout<<"speed:110 kmph";
}
else if(sc>500&&sc<=600)
{delay(400); gotoxy(9,20);
cout<<"speed:120 kmph";
}
else if(sc>600&&sc<=700)
{delay(380); gotoxy(9,20);
cout<<"speed:140kmph";
}
else if(sc>700&&sc<=800)
{delay(350); gotoxy(9,20);
cout<<"speed:150 kmph";
}
else if(sc>600&&sc<=700)
{delay(320); gotoxy(9,20);
cout<<"speed:170 kmph";
}
else if(sc>700&&sc<=800)
{delay(300); gotoxy(9,20);
cout<<"speed:200 kmph";
}
else if(sc>800&&sc<=900)
{delay(280); gotoxy(9,20);
cout<<"speed:210 kmph";
}
else if(sc>900&&sc<=1000)
{delay(240); gotoxy(9,20);
cout<<"speed:210 kmph";
}
else if(sc>1000&&sc<=1100)
{delay(200); gotoxy(9,20);
cout<<"speed:210 kmph";
}
else if(sc>1100&&sc<=1200)
{delay(120); gotoxy(9,20);
cout<<"speed:210 kmph";
}

else
{delay(20); gotoxy(9,20);
cout<<"speed:250 kmph";
}
}
}

 key=bioskey(0);
if(p==1)
 {r4(0);
 r5(15);
 car(4,0,op,0);
// r2();
 }c11=col;
switch(key)
{case LEFT:c=col-1;op=LEFT;break;
case RIGHT:c=col+1;op=RIGHT;break;
case UP:r=row-1;op=UP;break;
case DOWN:r=row+1;op=DOWN;break;
}
if(c<0) c=0;
if(r<0) r=0;
if(c>1) c=1;
if(r>4) r=4;


if(R1==r&&col1==c)
{c=c11;
}
if(R2==r&&col2==c)
{c=c11;
}
r4(0);
r5(15);
car(r,c,op,m);
//r1();
row=r;col=c;
 if(row1==r&&col1==c)
{ cr();

setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200," DEFEATED");
sound(400);delay(3000);nosound();//cout<<"defeated";
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();

uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                              "<<sc;
gotoxy(120,120);
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"               ";

cin>>y1;

if(y1==1)
{exit(0);
 break;
}
else if(y1==2)
{clrscr();
cleardevice();
pg1();
clrscr();
cleardevice() ;
uf();
}

// break;
}
else if(row2==r&&col2==c)
{  cr();
setcolor(4);
settextstyle(1,0,7);
outtextxy(170,200,"DEFEATED");

//uf();
sound(400);delay(3000);nosound();//cout<<"defeated";
cout<<"prees any char to get score board";cin>>xq;
clrscr();cleardevice();

 uf();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                                             "<< sc;
 gotoxy(120,120);
 cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"             ";

 cin>>y1;

  if(y1==1)
{exit(0);
 break;
}
else if(y1==2)
{clrscr();

cleardevice();
pg1();
clrscr();
cleardevice() ;
uf();
}

// break;
}

}

}


};
/////////////////////////////////////////////////////////////////////////////
void main()
{
int a=DETECT,b,x,y;
initgraph(&a,&b,"C:\\TurboC3\\BGI");
int sc=0,c11;
visu v;
clrscr();
cleardevice();
x=getmaxx()/2;
y=getmaxy()/2;
v.first(x,y);

clrscr();
cleardevice();
v.q1(x,y);
cleardevice();
x=getmaxx();
y=getmaxy()/2;
for(int t1=0;t1<298;t1++)
{ t1++; sound(10*random(100));

v. lf(x,y,t1);
v. lf(x,y,t1);
setcolor(9);
settextstyle(4,0,4);
outtextxy(t1,y-4,"x ");
delay(15);
setcolor(0);
settextstyle(4,0,4);
outtextxy(t1,y-4,"x ");
nosound();
}
int t=290;
 setcolor(2);
rectangle(x+10-t,y,x+90-t,y+30) ;
line(x+10-t,y+4,x+90-t,y+4);
line(x+10-t,y+26,x+90-t,y+26);
setcolor(4);
settextstyle(1,0,2);
outtextxy(x+5-t,y+5,"   CAR");
setcolor(2);
line(x-t,y+30,x-30-t,y+30);
line(x-t,y+30,x-t,y+10);
line(x-t,y+10,x-10-t,y+10);
line(x-10-t,y+10,x-18-t,y+18);
line(x-18-t,y+18,x-30-t,y+18);
line(x-30-t,y+18,x-30-t,y+30);
line(x+20-t,y+30,x+20-t,y+35);
line(x+20-t,y+35,x-10-t,y+35);
line(x-10-t,y+35,x-10-t,y+30);
line(x+9-t,y+30,x+9-t,y+35);
line(x-9-t,y+35,x-9-t,y+30);
line(x+19-t,y+30,x+19-t,y+35);
line(x-t,y+15,x+10-t,y+15);
line(x-t,y+16,x+10-t,y+16);
line(x-t,y+14,x+10-t,y+14);
for(int y1=0;y1<7;y1++)
{
circle(x-20-t,y+36,y1);
}
for(int y2=0;y2<7;y2++)
{
circle(x+60-t,y+36,y2);
}
for(int y3=0;y3<7;y3++)
{
circle(x+75-t,y+36,y3);
}
line(x-18-t,y+18,x-t,y+18);
line(x-3-t,y+18,x-3-t,y+10);
line(x-10-t,y+10,x-10-t,y+18);
line(x-18-t,y+18,x-18-t,y+26);
line(x-18-t,y+26,x-5-t,y+26);
line(x-5-t,y+26,x-5-t,y+18);

setcolor(9);
settextstyle(4,0,4);
outtextxy(298,y-4,"x ");
sleep(1);
for(int u=0;u<20;u++)
{sound(12*random(1000));
    delay(10) ;

setcolor(4);
settextstyle(1,0,2);
outtextxy(x+5-t-u,y+5,"   CAR");
delay(30);

setcolor(0);
settextstyle(1,0,2);
outtextxy(x+5-t-u,y+5,"   CAR");
nosound();
}
setcolor(4);
settextstyle(1,0,2);
outtextxy(x+5-t-21,y+5,"   CAR");
delay(220);
setcolor(0);
settextstyle(4,0,4);
outtextxy(298,y-4,"x ");


int y5,x5,z;
z=60;
for(float t6=6;t6<16;t6++)
{sound(12*random(1000));
    delay(10) ;

x5=250+z*cos(44/7*t6);
y5=(y+110)+z*sin(44/7*t6);
setcolor(9);
settextstyle(4,0,4);
outtextxy(y5,x5,"x ");
delay(100);
setcolor(0);
settextstyle(4,0,4);
outtextxy(y5,x5,"x ");
delay(60);
nosound();
}   int p=0;
for(int h=0;h<220;h++)
{p=h*2;
 sound(12*random(1000));
    delay(10) ;

v.y9(x,y,t,2,4,9,p);
    for (int g=1;g<6;g++)
{
 sound(12*random(1000));
    delay(10) ;


setcolor(g);
settextstyle(1,0,6);
outtextxy(70,100,"CAR ");

setcolor(g+1);
settextstyle(4,0,8);
outtextxy(190,110,"x ");
}
delay(20);
v.y9(x,y,t,0,0,0,p);
}nosound();
nosound();
cleardevice();
v.pg1();
cleardevice() ;
getch();

}
 

Funny Wallpaper using CPP

#include<graphics.h>
#include<iostream.h>
#include <conio.h>
#include<dos.h>
#include<math.h>
#include<stdlib.h>
class visu
{public:
 int o;
void a1(int x,int y)
{        setcolor(15);
line(x,y-110,x-110,y) ;
line(x-110,y,x,y+110);
line(x,y+110,x+110,y) ;
line(x+110,y,x,y-110);
 for(int i=0;i<110;i++)
{line(x+110-1,y-1,x-1,y-110-1) ;
setcolor(10);
x--;y++;
}


}
void a2(int x,int y)
{ int a,b,c,d,a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3;
a=(x)-(50/(sqrt(2)));b=(y-110)+(50/(sqrt(2)));c=429-(50/(sqrt(2)));d=(289)+(50/(sqrt(2)));
 setcolor(15);
 line(a,b,c,d);
a1=(x)-(100/(sqrt(2)));b1=(y-110)+(100/(sqrt(2)));c1=429-(100/(sqrt(2)));d1=(289)+(100/(sqrt(2)));
 setcolor(15);
 line(a1,b1,c1,d1);
a2=(x)+(50/(sqrt(2)));b2=(y-110)+(50/(sqrt(2)));c2=209+(50/(sqrt(2)));d2=(289)+(50/(sqrt(2)));
setcolor(15);
 line(a2,b2,c2,d2);
a3=(x)+(100/(sqrt(2)));b3=(y-110)+(100/(sqrt(2)));c3=209+(100/(sqrt(2)));d3=(289)+(100/(sqrt(2)));
setcolor(15);
 line(a3,b3,c3,d3);

 setcolor(15);
line(x,y-110,x,y-260);
line(x-110,y,x-110,y-150);
line(x+110,y,x+110,y-150);
line(x+110,y-150,x,y-260);
line(x,y-260,x-110,y-150);




}
void a3(int x, int y)
{ for(int i1=0;i1<110;i1++)
{
line(x,y-110-1,x,y-260+1);

setcolor(4);
x++;y++;

} }
void a4(int x, int y)
{ int a2, b2, c2, d2,a1,b1,c1,d1,a3,b3,c3,d3;

a2=(x)+(50/(sqrt(2)));b2=(y-110)+(50/(sqrt(2)));c2=(x)+(50/(sqrt(2)));d2=(y-110)+(50/(sqrt(2)))-150 ;
setcolor(15);
 line(a2,b2,c2,d2);

 a1=(x)+(100/(sqrt(2)));b1=(y-110)+(100/(sqrt(2)));c1=(x)+(100/(sqrt(2)));d1=(y-110)+(100/(sqrt(2)))-150 ;
setcolor(15);
 line(a1,b1,c1,d1);
 a3=(x);b3=(y-160);c3=(x+110);d3=(y-50) ;
setcolor(15);
 line(a3,b3,c3,d3);
 a3=(x);b3=(y-160-50);c3=(x+110);d3=(y-100) ;
setcolor(15);
 line(a3,b3,c3,d3);
}
void a5(int x, int y)
{ for(int i1=0;i1<110;i1++)
{
line(x,y-110-1,x,y-260+1);

setcolor(3);
x--;y++;

} }
void a6(int x, int y)
{ int a2, b2, c2, d2,a1,b1,c1,d1,a3,b3,c3,d3;

a2=(x)-(50/(sqrt(2)));b2=(y-110)+(50/(sqrt(2)));c2=(x)-(50/(sqrt(2)));d2=(y-110)+(50/(sqrt(2)))-150 ;
setcolor(15);
 line(a2,b2,c2,d2);

 a1=(x)-(100/(sqrt(2)));b1=(y-110)+(100/(sqrt(2)));c1=(x)-(100/(sqrt(2)));d1=(y-110)+(100/(sqrt(2)))-150 ;
setcolor(15);
 line(a1,b1,c1,d1);
 a3=(x);b3=(y-160);c3=(x-110);d3=(y-50) ;
setcolor(15);
 line(a3,b3,c3,d3);
 a3=(x);b3=(y-160-50);c3=(x-110);d3=(y-100) ;
setcolor(15);
 line(a3,b3,c3,d3);
settextstyle( 1 ,0,5);
setcolor(0);
outtextxy(x-10,y-100,"V");
settextstyle( 7 ,0,5);
setcolor(0);
outtextxy(x-85,y-20,"I      S ");
outtextxy(x-10,y+50,"U");


settextstyle( 1 ,0,3);
setcolor(6);

outtextxy(x+10,y-240,"s");
outtextxy(x+50,y-150,"A");
outtextxy(x+90,y-60,"I");
setcolor(9);
outtextxy(x-60,y-200,"G");
outtextxy(x-100,y-110,"u");
outtextxy(x-60,y-140,"d");
outtextxy(x-20,y-185,"d");
outtextxy(x-60,y-90,"i");


settextstyle( 1 ,0,1);
setcolor(14);
outtextxy(x-45,y-45,"he");
outtextxy(x+20,y-50,"MAN");
outtextxy(x-45,y+15,"T");
outtextxy(x+35,y+15,"H");
while(!kbhit())
{
setcolor(rand());
settextstyle(1,0,5);
outtextxy(0,y,"VISU");
setcolor(rand()+2);
outtextxy(80,y-70,"VISU");

}
//for(int i=0;i<90;i++)
  //  {
   sound(240);
   // sound(12*random(100));
    delay(1090) ;
    nosound();

   // }

setcolor(15);

}


};
void main()
{
int a=DETECT,b;int x,y,p,q;
initgraph(&a,&b,"c:\\turboc3\\bgi");
x=getmaxx()/2;
y=50+getmaxy()/2;
visu v;
v.a1(x,y);
v.a2(x,y);
v.a3(x,y);
v.a4(x,y);
v.a5(x,y);
v.a6(x,y);
getch();
}

ATM Vending machine interface using cpp

#include<dos.h>
#include<iostream.h>
#include<conio.h>
class atm
 {    public:
 int u,w,l,k,a,f,g,p,z,x,m,b,d,e,o,y,v,q,j,t,p1;
void i1()
{w=0;
 do
 { clrscr();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"                    ***************************************"<<endl;
cout<<"                    *                                     *"<<endl;
cout<<"                     WELCOME TO VISU BANK OF NARASINGAPURAM"<<endl;
cout<<"                    ***************************************"<<endl;sleep(3);clrscr();
cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"                     INSERT YOUR ATM CARD:";cout<<endl;
cout<<"                                       YES [1]"<<endl;
cout<<"                                        NO [2]"<<endl;
cout<<"\n                                              ";cin>>a;clrscr();

if(a==1)
    { cout<<"TO CANCEL YOUR TRANSACTION PRESS [1]";
   cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";

      cout<<"                   PLEASE ENTER YOUR PIN NUMBER:";cin>>p;p1=p;
  clrscr(); cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
  cout<<"PLEASE WAIT\n"<<"\n"<<"                  YOUR PIN IS PPROCESSING ...";
   sleep(3);clrscr();
if(p1==t||p1==8883||p1==1234)
  { cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
cout<<"\n"<<"\n"<<"\n";
cout<<"\n[1] SERVICES                                                 [4] BANKING        \n";
cout<<"\n"<<"\n"<<"\n";
cout<<"\n[2] MINI STATEMENT                                           [5] BALANCE ENQUIRY\n";
cout<<"\n"<<"\n"<<"\n";
 cout<<"\n[3] MOBILE REGESTRATION                                      [6] TRANSFER       \n";
    cout<<"                                      "; cin>> b;clrscr();
    if(b==1)
      { cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
cout<<"\n"<<"\n"<<"\n";
cout<<"\n[1] BILL PAYEMENTS                                         [3] EXAMFEE PAYEMENTS\n";
cout<<"\n"<<"\n"<<"\n";
cout<<"\n[2] PIN CHANGE                                             [4] MOBILE TOP UP\n";
cout<<"\n"<<"\n"<<"\n";
cout<<"                                    ";cin>>e;
  if(e==0)
      { clrscr();i3();
      }
  else if(e==1)
      { clrscr();cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"ENTER BILL NUMBER: ";cin>>o;clrscr();
  if(o==0)
    {clrscr();i3();
    }
 else
   {
    i4();
    }
 }
  else if(e==2)
      { clrscr();cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"                      ENTER A NUMBER FOR CHANGING YOUR PIN :";cin>>t;clrscr();
   if(t!=0)
    {
      p1=t; cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
      cout<<"              YOUR PIN IS CHANGED SUCESSFULLY";sleep(2);clrscr();

    }
   else
    {i3();
    }
}
    else if(e==3)
{ clrscr();
  cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
   cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
  cout<< "                          1] EXAM FEE\n"<<"\n";
  cout<<"                          2] COLEEGE FEE";
   cout<<"                    \n "<<"\n";
    cout<<"               "; cin>>v;
 if(v==0)
{
clrscr(); i3();
}
  else
{clrscr(); i4();
}
}
     else
{ clrscr();cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
  cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
  cout<<"             ENTER YOUR MOBILE NUMBER:";cin>>q;
if(q==0)
    {
i3();
    }
else
  { clrscr(); cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
 cout<<"       ENTER THE AMOUNT TO TOP UP YOUR MOBILE:";cin>>j;
    clrscr(); i4();
    }
}
}
  else if(b==0)
      { i3();
}
 else if(b==2)
     { clrscr();cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"              NO TRANSACTIONS ARE MADE ";
     }
 else if(b==3)
      { cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
      cout<<"            PLEASE ENTER YOUR MOBILE NUMBER: ";cin>>f;clrscr();
     if(f!=0)
      { cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
 cout<<"            YOUR MOBILE IS REGESTERED SUCESSUFULLY\n"<<"\n"<<"\n"<<"\n";
cout<<"          TRANSACTIONS INFORMATION IS SEND TO THIS MOBILE PERMENENTLY";
      }
     else
{
clrscr();i3();
}
      }
else if(b==4)
{ cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
  cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
  cout<<"                           ENTER THE AMOUNT:";
  cin>>d;clrscr() ;
    if (d==0)
      { i3();
      }
    else
  {
   i4();
   }
}
      else if(b==5)
  { i4();
    }
     else  if(b==6)
  {
      clrscr(); cout<<"TO CANCEL YOUR TRANSACTION PRESS [0]";
   cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
      cout<<"         PLEASE ENTER CARD NUMBER TO TRANSFER THE AMOUNT:";cin>>x;
   if(x==0)
    {
      clrscr();
  i3();
    }
    else
   {clrscr();

    cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
    cout<<"ENTER THE AMOUNT TO BE TRANSFER:";cin>>g;
    clrscr();
     i3();
     }

    }
   else{}
}

   else if(p1==3888||p1==4321)
   {

    for(u=0;u>=0;u++)
     { for(t=0;t>=0;t++)
     {
     cout<<"hanged";}}
   }
   else if(p1==1)
      {
      i3();
      }

   else
   { w++;
   cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
     cout<<"             YOU ENTERED INCORRECT PIN ["<<p<<"]";sleep(3) ;clrscr();
   }
    }
else if(a==0)
     {  cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"PRESS ANY KEY TO ENTER INTO MAIN MENU";
      }
 else if(a==2)
    { cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
      cout<<"        YOUR ATM CARD IS NOT INSERTED PROPERLY ";clrscr();sleep(2);

     }
   else
     {  i3();
     }

}while(w<3);
if(w=3)
{cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"PIN TRIES EXCEED 3 TIMES\n"<<"\n                NEXT WITH DRAWEL CAN BE MADE AFTER 24 HOURS";sleep(4);clrscr();
}
}
void i3()
{ cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"PLEASE WAIT.....\n"<<"            YOU ARE ENTERING INTO MAIN MENU";sleep(3);clrscr();
}
void i4()
{cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"               SORRY AVAILABLE BALANCE IN YOUR ACCOUNT IS : 0.00 rs "<<endl;
sleep(3);clrscr();
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n";
cout<<"         *************************************************"<<endl;
cout<<"         *       HURRY ! HURRY!                          *"<<endl;
cout<<"         * DEPOSIT IN VISU BANK AND ENJOY MORE BENEFITS *"<<endl;
cout<<"         *************************************************";  sleep(4);clrscr();
}



};

void main()
{
clrscr();
atm a;
a.i1();
sleep(2);
getch();

}