Learning Cpp programming
The books I love about C++ are.
1. C++ How To Program by Deitel & Associates.
2. Object Oriented Programming In C++ by Robert Lafore.
2nd one is easy to read but 1st one contains in-depth understanding of C++.
first game!
void main()
{
int a = DETECT, b,X=-45,Y=-45,x,y;
char ch = 's';
srand(time(NULL));
initgraph(&a,&b,"c:\\tc\\bgi");
X = getmaxx()/2 - 45;
Y = getmaxy()/2 - 45;
while(ch != '\r')
{
if(rand() % 2 == 0)
{
x = (getmaxx()/2) + (rand() % 40);
y = (getmaxy()/2) + (rand() % 40);
}
else
{
x = (getmaxx()/2) - (rand() % 40);
y = (getmaxy()/2) - (rand() % 40);
}
while(ch != '\r')
{
circle(x,y,3);
circle(X,Y,5);
rectangle(getmaxx()/2+50,getmaxy()/2+50,getmaxx()/2-50,getmaxy()/2-50);
outtextxy(50,50,"Press w,s,a,d to play");
outtextxy(50,70,"Press ENTER to eixt");
outtextxy(50,90,"Press any other key to pause");
outtextxy(50,110,"Score, doesn't know how to show variables");
if(kbhit())
ch = getch();
switch(ch)
{
case 'w':
if(Y = x && (X-7) = y && (Y-7)
Click here to claim your Sponsored Listing.
Category
Contact the business
Telephone
Website
Address
Gujranwala