Subscribe Our Channel

header ads

Search This Blog

Thursday, November 4, 2021

valentine day c++ programming

 



// WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL

// PROGRAM TO WISH VALENTINE'S DAY


#include<stdio.h>

#include<conio.h>

#include<graphics.h>

#include<dos.h>

#include<stdlib.h>

#include<math.h>

void text();

void children();

void graphic();

void main()

{

graphic();

text();

children();

while(!kbhit())

{

putpixel(rand()%700,rand()%700,YELLOW);

delay(1);

}

closegraph();

graphic();

int i=0,j;

int x,y;

int color;

setlinestyle(0,0,1);

while(kbhit())

{

color=rand()%15+1;

settextstyle(8,0,6);

setcolor(color+3);

outtextxy(0,(getmaxy()/2)-100,"Happy Valentine Day");

outtextxy(0,(getmaxy()/2)-30,"--ROHIT TECH STUDY");

x=rand()%1366;

y=rand()%768;

for(i=768;i!=y;i--)

{

if(i%50==0)

delay(1);

putpixel(x,i,14);

}

for(i=768;i!=y;i--)

{

if(i%70==0)

delay(1);

putpixel(x,i,0);

}

for(j=0;j!=100;j+=5)

{

for(i=0;i!=360;i+=15)

{

setcolor(color);

line(x,y,x+j*cos(3.14/180*i),y+j*sin(i*3.14/180));

}

}

setcolor(0);

for(j=0;j!=100;j++)

{

for(i=0;i!=360;i+=15)

line(x,y,x+j*cos(3.14/180*i),y+j*sin(i*3.14/180));

}

}

getch();

closegraph();

}

void graphic()

{

int gd=DETECT,gm;

initgraph(&gd,&gm,"C:\\TC\\BGI");

}

void text()

{

setcolor(RED);

settextstyle(0,EMPTY_FILL,1);

outtextxy(250,420,"ROHIT");

outtextxy(350,420,"VALENTINE");

setcolor(MAGENTA);

settextstyle(0,EMPTY_FILL,4);

outtextxy(50,20,"HAPPY VALENTINE'S");

outtextxy(270,70,"DAY");

}

void children()

{

setcolor(76);

ellipse(306,310,0,360,5,10);

ellipse(306,310,0,360,10,5);

circle(306,310,5);

circle(306,310,3);

line(306,355,306,315);

setcolor(WHITE);

line(0,415,700,415);

//boy

circle(250,300,20);

rectangle(225,325,275,375);

line(243,320,243,325);

line(255,320,255,325);

line(275,375,300,375);

line(300,375,300,405);

line(250,390,285,390);

line(285,390,285,405);

rectangle(285,405,310,415);

line(235,375,235,400);

line(250,375,250,415);

line(210,400,235,400);

line(210,400,210,415);

line(275,335,300,335);

line(275,345,300,345);

line(275,355,300,355);

line(300,335,300,355);

line(300,335,305,335);

line(300,337,305,337);

line(300,339,305,339);

line(300,341,305,341);

line(300,343,305,343);

line(300,345,305,345);

line(300,347,305,347);

line(300,349,305,349);

line(300,351,305,351);

line(300,353,305,353);

line(300,355,305,355);


//girl

circle(390,285,20);

line(395,305,395,310);

line(385,305,385,310);

line(385,310,355,365);

line(395,310,425,365);

line(355,365,425,365);

line(370,365,370,405);

line(385,365,385,405);

line(390,365,390,405);

line(405,365,405,405);

rectangle(360,405,385,415);

rectangle(385,405,405,415);

line(345,325,375,325);

line(345,335,370,335);

line(345,345,364,345);

line(345,325,345,345);

line(340,325,345,325);

line(340,327,345,327);

line(340,329,345,329);

line(340,331,345,331);

line(340,333,345,333);

line(340,335,345,335);

line(340,337,345,337);

line(340,339,345,339);

line(340,341,345,341);

line(340,343,345,343);

line(340,345,345,345);

}

happy govardhan puja c++ programming




//____________ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL _____________//

//************* C++ PROGRAM TO CELEBRATE HAPPY GOVARDHAN PUJA *************//


#include<stdio.h>

#include<conio.h>

#include<dos.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

int i;


initgraph(&gd,&gm,"c:\\tc\\bgi");

{

for(i=0;i<50;i++)

{

setbkcolor(4);

setcolor(YELLOW);


line(50,0,50,250);

line(51,0,51,250);

ellipse(51,245,0,360,2,10);

arc(50,250,180,360,30);

arc(50,250,180,360,29);

arc(50,250,180,360,28);

ellipse(50,250,0,360,30,3);

ellipse(50,250,0,360,30,1);


line(100,0,100,125);

line(101,0,101,125);

ellipse(101,120,0,360,2,10);

arc(100,125,180,360,30);

arc(100,125,180,360,29);

arc(100,125,180,360,28);

ellipse(100,125,0,360,30,3);

ellipse(100,125,0,360,30,1);


line(540,0,540,125);

line(541,0,541,125);

ellipse(541,120,0,360,2,10);

arc(540,125,180,360,30);

arc(540,125,180,360,29);

arc(540,125,180,360,28);

ellipse(540,125,0,360,30,3);

ellipse(540,125,0,360,30,1);


line(590,0,590,250);

line(591,0,591,250);

ellipse(591,245,0,360,2,10);

arc(590,250,180,360,30);

arc(590,250,180,360,29);

arc(590,250,180,360,28);

ellipse(590,250,0,360,30,3);

ellipse(590,250,0,360,30,1);


setcolor(i++);

circle(320,170,150);

circle(320,170,148);

circle(320,170,146);

circle(320,170,144);

circle(320,170,142);

circle(320,170,140);


setcolor(YELLOW);

arc(320,270,180,360,40);

ellipse(300,270,0,360,20,5);

ellipse(340,270,0,360,20,5);

ellipse(320,253,0,360,5,18);


line(0,400,50,350);

line(50,350,100,400);

line(100,400,150,350);

line(150,350,200,400);

line(200,400,250,350);

line(250,350,300,400);

line(300,400,350,350);

line(350,350,400,400);

line(400,400,450,350);

line(450,350,500,400);

line(500,400,550,350);

line(550,350,600,400);

line(600,400,650,350);


line(0,325,30,370);

line(65,365,100,325);

line(100,325,135,365);

line(165,365,200,325);

line(200,325,235,365);

line(265,365,300,325);

line(300,325,335,365);

line(365,365,400,325);

line(400,325,435,365);

line(465,365,500,325);

line(500,325,535,365);

line(565,365,600,325);

line(600,325,635,365);


setfillstyle(SOLID_FILL,6);

circle(320,170,140);

floodfill(320,170,YELLOW);


setcolor(YELLOW);

settextstyle(3,0,4);

outtextxy(285,70,"HAPPY");

settextstyle(1,0,4);

outtextxy(240,120,"GOVARDHAN");

outtextxy(285,170,"PUJA");


setcolor(WHITE);

settextstyle(1,0,1);

outtextxy(450,410,"WISHES FROM:-");

outtextxy(450,435,"ROHIT TECH STUDY");

delay(500);

}

}

getch();

}


 

Tuesday, November 2, 2021

BOAT MOVE C++ PROGRAM

 



//__________ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL _______________//

//-----------------C program to draw the moving boat ----------------------//


#include <conio.h>

#include <dos.h>

#include <graphics.h>

#include <stdio.h>


// Driver Code

int main()

{

// Initialize graphic driver

int gdriver = DETECT, gmode, err;

int i = 0, j, x, y, x1, y1, x2, y2;


initgraph(&gdriver, &gmode,"C:\\TC\\BGI");

err = graphresult();


if (err != grOk)

 {

printf("Graphics Error: %s\n",grapherrormsg(err));

return 0;

}


j = 0;


// Initialize position for boat

x = 50, y = getmaxy() / 2 + 140;


while (x + 60 < getmaxx() && (!kbhit()))

{


// Set the positions for rain

x1 = 10, i = y1 = 0;

x2 = 0, y2 = 50;


// Clears graphic screen

cleardevice();


// Set the color of river/sea

setcolor(LIGHTBLUE);

setlinestyle(SOLID_LINE, 1, 1);

setfillstyle(SOLID_FILL,LIGHTCYAN);


// Draw the river/sea

rectangle(0, getmaxy() / 2 + 150,getmaxx(), getmaxy());

floodfill(getmaxx() - 10,getmaxy() - 10,LIGHTBLUE);


// Rain drops

setlinestyle(DASHED_LINE, 1, 2);

while (i < 700)

{

line(x1, y1, x2, y2);

x1 = x1 + 20;

y2 = y2 + 50;

i++;

}


// Drawing the boat

setlinestyle(SOLID_LINE, 1, 2);

setcolor(LIGHTRED);


setfillstyle(SOLID_FILL, LIGHTRED);

sector(x, y, 180, 360, 50, 10);


setcolor(YELLOW);

setlinestyle(SOLID_LINE, 1, 3);


// Leg and body of stick man

line(x + 40, y - 15, x + 40, y - 40);

line(x + 40, y - 15, x + 45, y - 10);

line(x + 45, y - 10, x + 45, y);

line(x + 40, y - 15, x + 37, y);


// Head and hand of stick man

circle(x + 40, y - 45, 5);

line(x + 40, y - 35, x + 50, y - 30);

line(x + 40, y - 35, x + 35, y - 32);

line(x + 35, y - 32, x + 45, y - 25);

line(x + 60, y - 45, x + 27, y + 10);


// Moving the position of boat and stick man

x++;

setcolor(LIGHTBLUE);


delay(250);


// Clears the graphic device

cleardevice();


// Drawing sea/river

setlinestyle(SOLID_LINE, 1, 1);

setfillstyle(SOLID_FILL,LIGHTCYAN);


rectangle(0, getmaxy() / 2 + 150,getmaxx(), getmaxy());

floodfill(getmaxx() - 10,getmaxy() - 10,LIGHTBLUE);


// Rain drops

setlinestyle(DASHED_LINE, 1, 2);

x1 = 10, i = y1 = 0;

x2 = 0, y2 = 70;


while (i < 700)

{

line(x1, y1, x2, y2);

x1 = x1 + 30;

y2 = y2 + 60;

i++;

}


// Drawing the boat

setlinestyle(SOLID_LINE, 1, 1);

setcolor(RED);

setfillstyle(SOLID_FILL, LIGHTRED);

sector(x, y, 180, 360, 50, 10);


// Body and leg of stic man

setcolor(YELLOW);

setlinestyle(SOLID_LINE, 1, 3);

line(x + 40, y - 15, x + 40, y - 40);

line(x + 40, y - 15, x + 45, y - 10);

line(x + 45, y - 10, x + 45, y);

line(x + 40, y - 15, x + 37, y);


// Head hands of stick man

circle(x + 40, y - 45, 5);

line(x + 40, y - 35, x + 52, y - 30);

line(x + 40, y - 35, x + 37, y - 32);

line(x + 37, y - 32, x + 49, y - 25);

line(x + 60, y - 45, x + 27, y + 10);


// Forwarding the position of the boat


x++;


// Sleep for 250 milliseconds

delay(150);


// Clears the graphic device

cleardevice();

j++;

}


getch();

closegraph();

return 0;

}


MOVING BOAT IN C++ | BOAT MAN PROGRAMMING IN C



 //____________ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL ____________//

//___________________ C++ PROGRAM TO MOVING BOAT _________________________//


#include<conio.h>

#include<stdio.h>

#include<graphics.h>

#include<math.h>

#include<stdlib.h>

#include<dos.h>

int gd=DETECT,gm,xmax,ymax,x,y,tx,ty;


void drawBoat()

{

static int t=0;

line(x,y,x+200,y);

line(x,y,x+20,y+60);

line(x+20,y+60,x+180,y+60);

line(x+180,y+60,x+200,y);

line(x+150,y,x+150,y-35);

setfillstyle(SOLID_FILL,BLACK);

fillellipse(x+150,y-50,15,15);


setfillstyle(SOLID_FILL,YELLOW);

fillellipse(x+150,y-60,35,3);

fillellipse(x+150,y-65,10,10);

setfillstyle(SOLID_FILL,BROWN);

floodfill(x+40,y+20,WHITE);

if(t<1)

 {

 line(x+150,y-25,x+130,y-15);

 line(x+130,y-15,x+110,y-19);

 line(x+150,y-25,x+107,y-25);


 line(x+107,y-25,x+110,y-10);

 line(x+115,y-10,x+108,y-10);

 line(x+115,y-10,x+135,y+60);

 line(x+108,y-10,x+128,y+60);

 line(x+135,y+60,x+128,y+60);

 }

else

 {

 line(x+150,y-25,x+135,y-20);

 line(x+140,y-20,x+120,y-10);

 line(x+150,y-25,x+120,y-20);


 line(x+120,y-20,x+130,y-5);

 line(x+123,y-5,x+118,y-5);

 line(x+118,y-5,x+150,y+60);

 line(x+123,y-5,x+158,y+60);

 line(x+123,y+60,x+158,y+60);

 }

t=(t+1)%4;


}


void drawWave()

{

static int waveh=10,hdiff=0,phasediff=10;

tx=0;

ty=y+40;

for(;tx<xmax*3;tx+=3)

 {

 putpixel(tx/3,(ty+hdiff)+waveh*sin((tx+phasediff)*3.14f/180),3);

 }

hdiff=(hdiff+2)%4;

phasediff=(phasediff+20)%70;

setfillstyle(SOLID_FILL,3);

floodfill(xmax-1,ymax-2,3);

}


void rain()

{

int i,rx,ry;

setcolor(WHITE);

for(i=0;i<1000;i++)

 {

 rx=random(xmax);

 ry=random(ymax);

 if(ry<y+40)

 {

 if((ry>y+10||ry<y-77))

  line(rx,ry,rx+2,ry+2);

 else if((rx<x+90||rx>x+180))

  {

  line(rx,ry,rx+2,ry+2);

  }

 }

 }

}


void main()

{

initgraph(&gd,&gm,"C:\\TC\\BGI");

cleardevice();

xmax=getmaxx();

ymax=getmaxy();

x=250;

y=ymax-150;

while(!kbhit())

 {

 x-=8;

 drawBoat();

 drawWave();

 rain();

 delay(300);

 cleardevice();

 }

getch();

}

Sunday, October 31, 2021

Heart break kid game in c++, C++ PROJECT, C PROJECT

 


//++++++++++ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL ++++++++++++++++//

//*********************   Heart Breaking Kid Game    ***********************//


#include <stdio.h>

#include <ctype.h>

#include <alloc.h>

#include <graphics.h>

#include <dos.h>

#include <stdlib.h>

#include <conio.h>


#define n 25

void start(void);

void end(void);

void rhits(void);

void yhits(void);

void phits(void);

char *msg;

void *ball, *ball1, *ball2, *gun, *bomb[n];


void *rhrt[n], *yhrt[n], *phrt[n];

int rflag[n], yflag[n], pflag[n];

int rx[n], ry[n], yx[n], yy[n], px[n], py[n];

int j, life = 3;

int rin=0, yin=0, pin=0;

unsigned int size,size1,size2,size3,size4;

int count = 0, r = 10, bct=0;

int nohits = 0, i;

int ats = 0;

int xend = 400, yend = 450;

char che = 3, ch;

int flag = 1, x = 5, gx = 4, hitflag[n];

int speed = 1, hity[n], hitx[n];

int x1 = 200, x2 = 377;

int ti=500;

int flag1 = 1, flag2 = 1;

int rhit = 0, yhit = 0, phit = 0;

struct  time t;


void main(void)

{

int gd = DETECT, gm;

initgraph(&gd, &gm, "c:\\tc\\bgi");

sprintf(msg,"%c",che);

setcolor(RED);

settextstyle(0,0,30);

outtextxy(getmaxx()/2-130,getmaxy()/2-100,msg);

setcolor(WHITE);

settextstyle(0,0,0);

outtextxy(getmaxx()/2-120,getmaxy()/2-30,"HEART BREAKING GAME");

outtextxy(getmaxx()/2-130,getmaxy()/2-50,"MODIFY BY ROHIT TECH STUDY");

getch();


cleardevice();


start();

for(i=0;i<n;i++)

{

hitflag[i] = 0;

rflag[i] = 0;

yflag[i] = 0;

pflag[i] = 0;

}


setcolor(RED);

settextstyle(0,0,2);

outtextxy(8,10,msg);


setcolor(12);

setlinestyle(0,0,THICK_WIDTH);


rectangle(1,1,xend,getmaxy());

rectangle(1,1,getmaxx()-1,getmaxy()-1);


setfillstyle(10,12);

bar(xend+1,2,getmaxx()-2,100);

rectangle(xend,100,getmaxx()-1,200);


line(xend,285,getmaxx(),285);

line(1,yend,getmaxx(),yend);


setcolor(RED);

settextstyle(0,0,2);

outtextxy(xend+20,200+10,msg);


setcolor(YELLOW);

settextstyle(0,0,2);

outtextxy(xend+110,200+10,msg);


setcolor(12);

settextstyle(0,0,2);

outtextxy(xend+195,200+10,msg);


setcolor(RED);

setlinestyle(0,0,NORM_WIDTH);

circle(r+5,r+5,r);


setcolor(YELLOW);

settextstyle(0,0,2);

outtextxy(203,155,msg);


setcolor(YELLOW);

setlinestyle(0,0,NORM_WIDTH);

circle(r+200,r+150,r);


setcolor(12);

settextstyle(0,0,2);

outtextxy(xend-20,255,msg);


setcolor(12);

setlinestyle(0,0,NORM_WIDTH);

circle(xend-r-3,r+250,r);



setcolor(11);

setlinestyle(0,0,THICK_WIDTH);

line(5,yend-5,20,yend-5);

line(5,yend-5,13,yend-14);

line(20,yend-5,13,yend-14);


size = imagesize(5,5,25,25);

ball = malloc(size);

getimage(5,5,25,25,ball);


size = imagesize(200,150,220,170);

ball1 = malloc(size);

getimage(200,150,220,170,ball1);


size = imagesize(377,250,397,270);

ball2 = malloc(size);

getimage(377,250,397,270,ball2);


size = imagesize(4,yend-4,21,yend-14);

gun = malloc(size);

getimage(4,yend-4,21,yend-14,gun);


setfillstyle(1,12);

bar(4,yend+3,xend-3,getmaxy()-4);

setcolor(11);

settextstyle(0,0,0);

setcolor(14);

settextstyle(4,0,2);

outtextxy(xend+25,20,"HEART BREAK KID");

outtextxy(xend+50,55,"GAME ZONE");



settextstyle(0,0,1);

setcolor(10);

outtextxy(xend+10,315,"Right Arrow Move Right Side");

outtextxy(xend+10,345,"Left Arrow Move Left Side");

outtextxy(xend+10,375,"Up Arrow To Fire The Arrow");

outtextxy(xend+10,405,"Press E to Exit");


randomize();

while(1)

{

if(life==0)

{

delay(1000);

end();

}

gotoxy(52,16);

printf("%3d",rhit);

gotoxy(63,16);

printf("%3d",yhit);

gotoxy(74,16);

printf("%3d",phit);

if(life<0)

life = 0;

gotoxy(55,12);

printf("Speed : %d Lifes : %2d",speed,life);

gotoxy(55,10);

printf("Total Points    : %4d",count);

gotoxy(55,8);

printf("No Of Attempts  : %4d",ats);

if(random(200-speed*10)==150-speed*5)

rhits();

if(random(200-speed*10)==77-speed*5)

phits();

if(random(200-speed*10)==111-speed*5)

yhits();

if(kbhit())

{

ch = getch();

if(ch==0)

{

ch = getch();

putimage(gx,yend-14,gun,XOR_PUT);


if(ch==75)

{

if(gx>=15)

gx -= 15;

}

else if(ch==77)

{

if(gx<=xend-25)

gx += 15;

}

putimage(gx,yend-14,gun,XOR_PUT);

if(ch==72&&life>0)

{

ats += 1;

int remflag = 0;

for(i=0;i<n;i++)

{

if(hitflag[i]>1)

{

hitflag[i]= 1;

remflag = 1;

hitx[i] = gx + 8 - 3;

hity[i] = yend - 14 - 15;

putimage(hitx[i],hity[i],bomb[i],XOR_PUT);

break;

}

}

if(remflag==0)

{

for(i=0;i<n;i++)

if(hitflag[i]==0)

{

bct = i;

nohits = i;

break;

}

hitflag[bct] = 1;

setcolor(10);

setlinestyle(0,0,NORM_WIDTH);


line(gx+8,yend-15,gx+8,yend-14-15);

line(gx+8,yend-14-15,gx+5,yend-14-10);

line(gx+8,yend-14-15,gx+11,yend-14-10);


size1 = imagesize(gx+8-3,yend-15,gx+8+3,yend-14-15);

bomb[bct] = malloc(size1);

getimage(gx+8-3,yend-15,gx+8+3,yend-14-15,bomb[bct]);


hitx[bct] = gx + 8 - 3;

hity[bct] = yend - 14 - 15;

}

}

}

if(tolower(ch)=='e')

{

end();

}

}

for(i=0;i<n;i++)

if(hitflag[i]==1)

{

putimage(hitx[i],hity[i],bomb[i],XOR_PUT);

hity[i] = hity[i] - 8;


if(hitx[i]>=x&&hitx[i]<=x+20&&hity[i]>=5&&hity[i]<=25)

{

rhits();

count += 3;

rhit += 1;

hitflag[i] = 2;

}


if(hitx[i]>=x1&&hitx[i]<=x1+20&&hity[i]>=150&&hity[i]<=170)

{

yhits();

count += 2;

yhit+=1;

hitflag[i] = 2;

}


if(hitx[i]>=x2&&hitx[i]<=x2+20&&hity[i]>=250&&hity[i]<=270)

{

phits();

count += 1;

phit+=1;

hitflag[i] = 2;

}


if(hity[i]<=2)

{

hitflag[i] = 2;

}


if(hitflag[i]==1)

{

putimage(hitx[i],hity[i],bomb[i],XOR_PUT);

}

}

if(ti>=500)

{

gettime(&t);

sprintf(msg,"Current Time:%2d:%02d:%02d",t.ti_hour, t.ti_min,t.ti_sec);


setfillstyle(1,12);

bar(xend+3,yend+3,getmaxx()-4,getmaxy()-4);

setcolor(BLACK);

settextstyle(0,0,0);

outtextxy(xend+15,yend+10,msg);

ti = 0;

}


putimage(x,5,ball,XOR_PUT);

putimage(x1,150,ball1,XOR_PUT);

putimage(x2,250,ball2,XOR_PUT);


if(flag==1)

x += speed;

else

x -= speed;


if(x>=xend-23)

{

flag = 0;

}

if(x<=1)

{

flag = 1;

}

if(flag1==1)

x1 += 1+speed;

else

x1 -= 1+speed;


if(x1>=xend-23)

{

flag1 = 0;

}

if(x1<=1)

{

flag1 = 1;

}

if(flag2==1)

x2 += 2+speed;

else

x2 -= 2+speed;


if(x2>=xend-23)

{

flag2 = 0;

}

if(x2<=1)

{

flag2 = 1;

}


putimage(x,5,ball,XOR_PUT);

putimage(x1,150,ball1,XOR_PUT);

putimage(x2,250,ball2,XOR_PUT);



for(i=0;i<n;i++)

if(rflag[i]==1)

putimage(rx[i],ry[i],rhrt[i],XOR_PUT);


for(i=0;i<n;i++)

if(yflag[i]==1)

putimage(yx[i],yy[i],yhrt[i],XOR_PUT);


for(i=0;i<n;i++)

if(pflag[i]==1)

putimage(px[i],py[i],phrt[i],XOR_PUT);


for(i=0;i<n;i++)

{

if(rflag[i]==1)

{

ry[i] += speed+2;

if(rx[i]>=gx-5&&rx[i]<=gx+20&&ry[i]>=yend-15&&ry[i]<=yend-5)

{


rflag[i] = 2;

life--;

}

}

}


for(i=0;i<n;i++)

{

if(yflag[i]==1)

{

yy[i] += speed+1;

if(yx[i]>=gx-5&&yx[i]<=gx+20&&yy[i]>=yend-15&&yy[i]<=yend-5)

{

yflag[i] = 2;

life--;

}

}

}


for(i=0;i<n;i++)

{

if(pflag[i]==1)

{

py[i] += speed;

if(px[i]>=gx-5&&px[i]<=gx+20&&py[i]>=yend-15&&py[i]<=yend-5)

{


pflag[i] = 2;

life--;

}

}

}


for(i=0;i<n;i++)

if(ry[i]>=yend-5)

{

rflag[i] = 2;

}


for(i=0;i<n;i++)

if(yy[i]>=yend-5)

{

yflag[i] = 2;

}



for(i=0;i<n;i++)

if(py[i]>=yend-5)

{

pflag[i] = 2;

}



for(i=0;i<n;i++)

if(rflag[i]==1)

putimage(rx[i],ry[i],rhrt[i],XOR_PUT);


for(i=0;i<n;i++)

if(yflag[i]==1)

putimage(yx[i],yy[i],yhrt[i],XOR_PUT);


for(i=0;i<n;i++)

if(pflag[i]==1)

putimage(px[i],py[i],phrt[i],XOR_PUT);



if(count<5) speed = 1;

if(count>=30)  speed = 2;

if(count>=60)  speed = 3;

if(count>=90)  speed = 4;

if(count>=120)  speed = 5;


delay(12-speed);

ti += 12-speed;

}

}

void end(void)

{

char m[3];

sprintf(m,"%c",3);

clrscr();

cleardevice();

restorecrtmode();

textattr(11);


cprintf("         ");

gotoxy(20,3);

cprintf("THE SCORE BOARD FOR HEART BREAK KID");

printf(" ");


cprintf("      ");

gotoxy(20,7);

textattr(11);

cprintf("TOTAL NUMBER OF FIRE SHOOTED : %d",ats);

gotoxy(20,9);

cprintf("TOTAL NUMBER OF POINTS SCORED : %d",count);

gotoxy(20,11);

textattr(RED);

cprintf("TOTAL NUMBER OF HITS TO RED HEART : %d",rhit);

gotoxy(20,13);

textattr(YELLOW);

cprintf("TOTAL NUMBER OF HITS TO YELLOW HEART : %d",yhit);

gotoxy(20,15);

textattr(12);

cprintf("TOTAL NUMBER OF HITS OT PINK HEART : %d",phit);

printf(" ");

textattr(11);


cprintf("    ");

getch();

exit(0);

}

void start(void)

{

cleardevice();

settextstyle(10,0,3);

setcolor(12);

outtextxy(150,100,"HEART BREAK KID");

settextstyle(0,0,2);

getch();

cleardevice();

}

void rhits(void)

{

int rflg = 0;

for(j=0;j<n;j++)

{

if(rflag[j]>1)

{

rflag[j] = 1;

rflg = 1;

rx[j] = x-1;

ry[j] = 26;

putimage(rx[j],ry[j],rhrt[j],XOR_PUT);

break;

}

}

if(rflg==0)

{

rflag[rin] = 1;

settextstyle(0,0,1);

setcolor(RED);

sprintf(msg,"%c",che);

outtextxy(x,28,msg);

size2 = imagesize(x-1,28-2,x+8,34);

rhrt[rin] = malloc(size2);

getimage(x-1,28-2,x+8,34,rhrt[rin]);

rx[rin] = x-1;

ry[rin] = 26;

for(j=0;j<n;j++)

if(rflag[j]==0)

{

rin = j;

break;

}

}

}

void yhits(void)

{

int yflg = 0;

for(j=0;j<n;j++)

{

if(yflag[j]>1)

{

yflag[j] = 1;

yflg = 1;

yx[j] = x1-1;

yy[j] = 171;

putimage(yx[j],yy[j],yhrt[j],XOR_PUT);

break;

}

}

if(yflg==0)

{

yflag[yin] = 1;

settextstyle(0,0,1);

setcolor(YELLOW);

sprintf(msg,"%c",che);

outtextxy(x1,171,msg);

size3 = imagesize(x1-1,171,x1+8,179);

yhrt[yin] = malloc(size3);

getimage(x1-1,171,x1+8,179,yhrt[yin]);

yx[yin] = x1-1;

yy[yin] = 171;

for(j=0;j<n;j++)

if(yflag[j]==0)

{

yin = j;

break;

}

}

}

void phits(void)

{

int pflg = 0;

for(j=0;j<n;j++)

{

if(pflag[j]>1)

{

pflag[j] = 1;

pflg = 1;

px[j] = x2-1;

py[j] = 281;

putimage(px[j],py[j],phrt[j],XOR_PUT);

break;

}

}

if(pflg==0)

{

pflag[pin] = 1;

settextstyle(0,0,1);

setcolor(12);

sprintf(msg,"%c",che);

outtextxy(x2,281,msg);

size4 = imagesize(x2-1,281,x2+8,289);

phrt[pin] = malloc(size4);

getimage(x2-1,281,x2+8,289,phrt[pin]);

px[pin] = x2-1;

py[pin] = 281;

for(j=0;j<n;j++)

if(pflag[j]==0)

{

pin = j;

break;

}

}

}


DIWALI WISHES PROGRAM IN C++

 



//___________ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL _______________//

//____________ C++ PROGRAM TO WISH HAPPY DIWALI/DEEPAVALI _________________//


#include<graphics.h>

#include<conio.h>

#include<stdio.h>

#include<stdlib.h>

#include<dos.h>

#include<math.h>

void main()

{

int i=0,gd=0, gm;

int j,kk;

int color;

int x,y;

initgraph(&gd,&gm,"C:\\TC\\BGI");


setcolor(LIGHTGREEN);

line(0, 400, 640, 400);

setcolor(LIGHTCYAN);

rectangle(300, 330, 340, 400);

rectangle(310, 320, 330,330);

setcolor(YELLOW);

line(319, 280, 319, 398);

line(320, 280, 320, 398);

setcolor(LIGHTRED);

rectangle(320, 280, 330, 300);

outtextxy(340, 280, "PRESS ANY KEY TO IGNITE THE ROCKET");

getch();

for(j=400; j<640; j++)

{

cleardevice();

setcolor(LIGHTGREEN);

line(0, j, 640, j);

rectangle(300, j-70, 340, j);

rectangle(310, j-80, 330, j-70);

setcolor(LIGHTCYAN);

line(319, 280, 319, 400);

line(320, 280, 320, 400);

rectangle(320, 280, 330, 300);

setcolor(YELLOW);

circle(325, 300, 2);

delay(5);

}

for(i=400; i>340; i--)

{

cleardevice();

setcolor(RED);

line(319, i, 319, i-120);

line(320, i, 320, i-120);

rectangle(320, i-120, 330,i-100);

setcolor(YELLOW);

circle(325, i-100, 2);

delay(25);

}

cleardevice();

kk=0;

for(j=100; j<350; j++)

{

if (j%20==0)

{

setcolor(kk);

kk=kk+3;

delay(50);

}

ellipse(320, 30, 0, 360, j+100,j+0);

}

for(j=100; j<350; j++)

{

if(j%20==0)

{

setcolor(BLACK);

delay(2);

}

ellipse(320,30,0,360,j+100,j+0);

}

cleardevice();

i=0;

while(!kbhit())

{

color=rand()%15+1;

settextstyle(2,0,6);

setcolor(color+3);

outtextxy(100,(getmaxy()/2)-60,"HAVE A CRACKLING DIWALI, MAY THIS SEASON");

outtextxy(100,(getmaxy()/2)-40,"BRING GOOD LUCK AND HAPPINESS TO YOU.");

settextstyle(3,HORIZ_DIR,5);

setcolor(color+1);

settextstyle(3,0,7);

outtextxy(80,(getmaxy()/5)-50,"HAPPY DIWALI!");


setcolor(color+1);

settextstyle(2,0,7);

outtextxy(150,(getmaxy()/5)-80,"FESTIVAL OF LIGHTS");

x=rand()%1366;

y=rand()%768;

for(i=768;i!=y;i--)

{

if(i%50==0)

delay(1);

putpixel(x,i,14);

}

for(i=768;i!=y;i--)

{

if(i%70==0)

delay(1);

putpixel(x,i,0);

}

for(j=0;j!=100;j+=5)

{

for(i=0;i!=360;i+=15)

{

setcolor(color);

line(x,y,x+j*cos(3.14/180*i),y+j*sin(i*3.14/180));

}

}

setcolor(0);

for(j=0;j!=100;j++)

{

for(i=0;i!=360;i+=15)

line(x,y,x+j*cos(3.14/180*i),y+j*sin(i*3.14/180));

}

}

cleardevice();

getch();

}

HAPPY DIWALI C PROGRAMMING

 



//>>>>>>>>WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL<<<<<<<<//

//............C++ PROGRAM TO WISH HAPPY DIWALI.................//


#include<conio.h>

#include<graphics.h>

#include<stdio.h>

#include<math.h>

#include<dos.h>

#include<stdlib.h>

int main()

{

int gd, gm;

int x, y;

int i, j, kk;


detectgraph(&gd, &gm);

initgraph(&gd, &gm,"C:\\TC\\BGI");


setcolor(WHITE);

line(0, 400, 640, 400);

rectangle(300, 330, 340, 400);

rectangle(310, 320, 330,330);

setcolor(4);

line(319, 280, 319, 398);

line(320, 280, 320, 398);

rectangle(320, 280, 330, 300);

outtextxy(340, 280, "PRESS ANY KEY TO IGNITE THE ROCKET");

getch();

for(j=400; j<640; j++)

{

cleardevice();

setcolor(WHITE);

line(0, j, 640, j);

rectangle(300, j-70, 340, j);

rectangle(310, j-80, 330, j-70);

setcolor(RED);

line(319, 280, 319, 400);

line(320, 280, 320, 400);

rectangle(320, 280, 330, 300);

setcolor(YELLOW);

circle(325, 300, 2);

delay(5);

}

for(i=400; i>340; i--)

{

cleardevice();

setcolor(RED);

line(319, i, 319, i-120);

line(320, i, 320, i-120);

rectangle(320, i-120, 330,i-100);

setcolor(YELLOW);

circle(325, i-100, 2);

delay(25);

}

cleardevice();

kk=0;

for(j=100; j<350; j++)

{

if (j%20==0)

{

setcolor(kk);

kk=kk+3;

delay(50);

}

ellipse(320, 30, 0, 360, j+100,j+0);

}

for(j=100; j<350; j++)

{

if(j%20==0)

{

setcolor(BLACK);

delay(2);

}

ellipse(320,30,0,360,j+100,j+0);

}

cleardevice();

i=0;

while(!kbhit())

{

setcolor(i++);

settextstyle(TRIPLEX_SCR_FONT, HORIZ_DIR,5);

outtextxy(30,150, "WISHES U HAPPY DIWALI!");

outtextxy(150, 250,"-ROHIT");

delay(90);

}

getch();

return 0;

}

Featured Post

Happy Republic Day Wish Using HTML and CSS | 26 January wish using HTML/CSS

 Happy Republic Day Wish Using HTML and CSS, 26 January wish using HTML/CSS <!-- WELCOME ALL OF YOU ON COMPUTER SOFT SKILLS CHANNEL -----...

Popular Posts