Professional Documents
Culture Documents
Cpss
Cpss
Hello everyone,I'm Guruprasad.I had attended CPSS(Computerised Pilot Selection System) once
and i can proudly say that i cleared it.
But while i was preparing for the exam, I was searching for content online to prepare for the test
but I hardly could find any games related to CPSS.
So after finishing my interview I thought why couldn't I try to make such games.I know a bit of C+
+ programming.So with the help of that knowledge
I have tried to create a game which is similar to the one conducted in actual game.Hope it helps
you guys(took more than 6hrs to make the game :) ).
So the game isnt exactly perfect.In the actual game the image grows on its own and it stops
growing when you press a button but here due to my little
programming knowledge I couldnt replicate that.Instead I have made it such a way that you have
to hold a button and the image grows. You have to stop once you feel that the
image is of same size of the actual image.Then wait for a second and you will get your result after
pressing any button.So if any programming expert can help me out with that I would be very
happy.So here is the actual code of the game I created
***********************************************************************************
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<time.h>
#include<iostream.h>
int main(void)
{
/* request auto detection */
int gmode, errorcode;
int midx, midy;
midx = getmaxx() / 2 ;
midy = getmaxy() / 2;
int trials=3;
outtextxy(150,midy,"This is a game developed by URGURU");
getch();
cleardevice();
// outtext("It is slightly different from the one conducted in cpss.In the actual game you have to
press a button when you feel the image growing is of same size of the actual image.\nBut here
hold any button and wait till you feel the actual image is of same size of the growing image");
for(int i=1;i<=trials;++i)
{
char intasstring[10];
itoa(i,intasstring,10);
cleardevice();
setfillstyle(1,random(10));
int temprad=0.1*midx+random(0.5*midx);
char chartemprad[10];
itoa(temprad,chartemprad,10);
time_t first,second;
for(int j=0;j<=(0.6*midx);++j)
{ first=time(NULL);
int tempo=midx-80;
char temprad2[10];
itoa(j,temprad2,10);
outtextxy(tempo,20,"Trial No:");
outtextxy(midx,20,intasstring);
fillellipse(midx*0.5, midy,temprad,temprad);
fillellipse(midx*1.5,midy,j,j);
getch();
second=time(NULL);
if(float(difftime(second,first))>1)
{
}
}
getch();
closegraph();
return 0;
}
***************************************************************************************************************
***********************************