Posts

Showing posts from 2017

Caught in the Middle

  Source Code: #include<iostream.h> #include<conio.h> #include<graphics.h> #include<stdlib.h> #include<dos.h> #include<stdio.h> enum dir direction;  /*indicates the direction of the shooter*/ int fire(int xco,int yco,int &lr,int &tb,int &rl,int &bt); /*shoots place check for hit*/ /*The most complex function flashes the green boxes and*/ /*records their coordinates*/ int environment(int xposition,int yposition,int position_array_location); int match(void);                  /*checks the fired location and the locations of the boxes*/ int put_banner(void);              /*banner at the end of game*/ /*structure to record the position of boxes*/ //void refresh(); struct position {     int x_pos;     int y_pos; }; struct po...

Heart Breaking Kid

Source Code: #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,"...