Posts

Showing posts from March, 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 position p[10]; /*array to record the locations of boxes*/ struct position sh; /*variable to record the location of the shooter*/ enum dir{EAST,WEST,SOUTH,NORTH}; /*enum to indicate dire